What is the TGSD Calculator?

This post follows up from the Faith of TGSD Calculator.

Before my four year too late discussion with David Marriott I wrongly believed that the TGSD Calculator computes a special kind of uncompensated accelerations that appear only at the points where any design element changes to another and turns those into a wave-like shape that the software can export. I called these waves “inertial waves” or “damped oscillations” which modelled – I believed – the “inertial response” of the track measurement coach, when passing over that change in alignment.

I wrongly believed that the Design (or Inherent) Standard Deviations are calculated from these waves.

With this twisted understanding of the process behind the TGSD Calculator I started my conversation with David Marriott. And he proved it all wrong.

I will not describe here the long discussion we had on this subject. I’ll come back to some of the main points in the following posts but first I will try, with the understanding I have today, to answer the question:

What is the TGSD Calculator?

The TGSD Calculator computes the Standard Deviation of the errors (artefacts) of the Butterworth filter when processing the design track.

Figure 1. Snapshot from the TGSD Calculator help file

This should be enough. But now, after all this time, it is not. We will need to understand who is the Good, the Bad and the Ugly of this definition. The following is based on the article “Track geometry standard deviation calculator” published by David Marriott in the PWI Journal.

The Good – Butterworth Filter

The track recording cars record the 3D alignment of the two rails. This 3D raw data set is processed within the measurement system to output the track traces (i.e. Twist, Top, Gauge, Alignment, Dip Angle). Figure 2 is an illustration of the process where the measurement raw data in this example is the measured track-left rail and the output required is the left rail Top irregularities – the Top Left trace.

Figure 2. Getting the rail irregularities from the measured raw data

To get the Top Left trace the recording system will need to automatically subtract the ideal track shape (the design alignment of the left rail) from the measured 3D shape of the left rail.

The same kind of subtraction is required to get all the other traces.
We, track design engineers, would think this can be easily done if the machine would have our design alignment in its memory to do this subtraction. It’s not that easy, as it would be very difficult to align the two data sets in real time. Also, in the raw data there is a certain amount of “noise”, un-useful data, that is also required to be taken out.

For the Top and Alignment traces the output is required to provide track irregularities that are relevant both as individual values (potential defects) or as a set that has a roughness that would potentially cause poor riding quality.

The way the track recording car takes out the ideal track shape and all the not useful data is by using a certain type of Butterworth Filter. This is an electronic circuit in the machine that cuts off from the raw measured signal all the waves above a standard established wavelength limit (35m and 70m).

The track design elements are defined by mathematical functions that are not periodical – are not waves.
The “wavelength” of all the alignment element functions (straight, curve, parabola, clothoid) is infinity.
Any measured trace that would contain these functions can be taken out by the Butterworth Filter used to produce the Top and Alignment track traces. Figure 3 shows a vertical parabola – the standard vertical curve for railway track alignment – and its filtered output to 70m cut-off wavelength. This filtered output is null. The Butterworth filter removes the vertical curve entirely. 

Figure 3. Filtered vertical parabola

It is important to note here that this removal of the track geometry design element does not relate to how compliant that element is. The vertical parabola can be designed to be below the railway limits for variation of the gravitational acceleration, g, or to match the Zero-g curve. The parabola that induces imponderability in the Zero-g planes will be also entirely removed by the Butterworth Filter. Same for a gradient – a 0.1% gradient will be removed as efficiently as a 50% gradient. A horizontal curve of 2000m radius will be removed as efficiently as a 20m radius curve. 

As long as it is continuous, any track design element is entirely removed by the Butterworth filters used to produce the track traces. Once again, this removal is not related to how complaint to design rules that design element is.

This removal process is done automatically, and it does not require the alignment element to be identified  -the ideal track shape in Figure 2 is not known – but still the filter takes out that shape and leaves in the trace only the vertical irregularities graph in Figure 2 – and a few other bits we’ll discuss later.

We, the track engineers, work with objective things that can be measured, weighted. It might seem strange and unbelievable to us that something unknown can be taken out from a measure to get something else. But filter circuits similar to the ones used on the track recording cars are in all the electronic equipment we use every day – a filter gives you the high-fidelity sound of your surround system, another reports your heartbeat and your number of steps on your smart watch, some others are used in Radar applications, helping planes to take out, fly and land safely. These filters do not require the “noise” they take out to be known – as long as its wavelengths  and the filter cut-off wavelength are well defined, the filters will efficiently take everything out. 
A set of Butterworth filters removes the design from the measured data to produce the track traces – see figure 4.

Figure 4. Quote from the Track Recording Handbook

The Bad –  Butterworth Filter artefact

Definition: In  signal processing, an artefact is any error in the representation of any information, introduced by the involved equipment or technique(s).

The track design elements are not waves.
The change from one element to another requires the same tangent but generally nothing more than that.
The sudden change from one design element to another, when processed through the Butterworth Filter, leaves behind an artefact, a processing error – very small in comparison to the data taken out.

Figure 5 illustrates this issue for a gradient change. The filtered output is practically null except an almost invisible variation that starts at chainage 150m and extends to 250m.

Figure 5. the filtered output of a gradient change

Figure 6. shows the same filtered output scaled up vertically 40 times. You can notice here that the design has elevation coordinates that vary from 1500mm to 1750mm . Thse elevations have been nullified by the filtering process except this wave-like shape that starts at 150 – where the gradient change is. The maximum amplitude of this error is 1.5 mm – insignificant in comparison to the thousands of millimeters taken out. 

Figure 6. the filtered output of a gradient change – scaled 40 times

Don’t be fooled by this shape, as I have.
Even though it looks like a wave this is not a wave, it has nothing to do with the accelerations, the waves or the inertial forces that the track or the railway vehicles are subjected to. 

Anything related to forces, accelerations and other similar concepts we would tend to correlate this shape with would require a speed input.
This artefact is independent of speed.
No speed input is required to get this shape.

This is just the result of passing the equations of two intersecting lines (that can be anything – trajectory of an airplane, sound volume settings, currency trend) through the mathematical representation of the Butterworth Filter. This wave-like shape is an artefact, a processing error. That shape does not exist in the raw vertical data and it is just the erroneous processing of the change of the geometrical rules that define the two design elements. 

In his article published in the PWI Journal, David Marriott metaphorically compared this artefact with what the Mercator projection does to the North and South Poles. This projection is the most used one to project the Earth on a cylinder and build the map of the world.

On any map of the world that projects the Earth spheroid on a vertical cylinder, the North and South poles are shown as lines equal in length to the Equator – see figure 7.

Figure 7. The Mercator projection – the North and South poles turned into lines.

This is a Mercator artefact – the two poles are adimensional points and not lines.
In a similar way, the Butterworth Filter turns the point of change of one design elements to another into a wave-like shape – an erroneous output that does not model correctly the point of change.

It is more to discuss here and for the purpose of keeping this long post short, I’ll ask you dear reader to trust me for now and wait for a later blog post that will present a bit more about this artefact.

Similar artefacts (filtering errors) are generated by the Butterworth Filter at every change from a design element to another. Figure 8. shows another example for two changes – one from straight to a transition curve and another from transition to a 2000m radius.

Figure 8. The filtered output of two curvature changes.


Also here we can notice the very small values this artefact has. In this case the maximum amplitude is 0.15mm.

The Ugly – Standard Deviation

Was this artefact known to the people who designed track measuring cars?
Most likely yes!
An I am sure they were happy with this error. Considering how much data is taken out, to have only a few millimetres dropped in the data in some very particular points, its an acceptable compromise.
The problem came when the Standard Deviation for each eighth of mile of the measured trace started to be calculated. These artefacts are small but they can have a noticeable influence on the measured SDs. 

Figure 9 shows an example of a trace recorded after a renewal and laid over the design artefact and their corresponding standard deviations. As you can notice, the artefact is in fact the main cause of the high SDs on the curve section of the site.

Figure 9. Design artefact and measured trace.

Time and time again, sites like this were tamped and re-tamped to get the track quality SD to a decent value. I hope you understand by now that it was not the tamping to blame for this but … 

No! Not the design! 

It is the Butterworth filter to blame for this.
The design is perfect!
Always perfect!
It cannot be Good, nor Satisfactory!
Never Poor!
The Butterworth Filter causes artefacts (errors) at every point where the design compliantly changes from one element to another. That artefact can sometime score as significant SD.

The Fix – TGSD Calculator

This issue was noticed by David Marriott and he developed in 2007 the TGSD Calculator for this sole purpose – to show what the SDs will be when the track recording car would run over the perfect alignment and these SDs to serve as a benchmark for the maintainer in observing the deterioration of the track quality. 

This Calculator is not a tool that models the dynamics of the track in any way. It does not calculate accelerations or inertial forces. It does not calculates inertial waves. 

The TGSD Calculator, developed by David Marriott in 2007, computes the Standard Deviation of the errors (artefacts) of the Butterworth filter when processing the design track.

Please, don’t believe any of the things I stated here.
Test this yourself.
Try to see if what this software calculates seems to be a “dynamic model” of the track … try to see if it can identify a good design …

Try this – a cant transition for adverse cant of -150mm to -120mm over a curve of 20m:

Figure 10. TGSD Calculator SD results for a 20m radius curve with a 150mm to 120mm adverse cant transition

Would a “dynamic”  calculation tool produce such results?

Would these SDs indicate an compliant design? Is this a good design?

Check to see if the cant correlates in any way with the horizontal alignment – as it would do if any dynamic modelling or riding quality assessment would be behind the software.
Check to see what happens when you remove the cant from your design.
Add adverse cant to your design and see what happens
See if you can find the Speed as an input for this software.

What would you expect to get from these tests and what are you actually getting?

Last but not least, read the article written by the engineer that developed the TGSD Calculator.


  1. The Butterworth Filter is used on the track recording cars to process the raw track measured data and to produce the track traces by removing all the design alignment elements and other long wavelength data.
  2. The Butterworth Filter removal of a design element from the measured data is not related to the compliance to standard rules of that element.
  3. At the point where a design element changes to another, the Butterworth Filter erroneously outputs a wave-like artefact. The size of this error (artefact) is insignificant in comparison to the amount of data taken out by the filter.
  4. The TGSD Calculator, developed by David Marriott in 2007, computes the Standard Deviation of the errors (artefacts) of the Butterworth filter when processing the design track.
  5. The Standard Deviations produced by the TGSD Calculator are not related to the quality or compliance of the processed design alignment. It is a measure of the Butterworth filter error (artefact) produced in the track recording trace.

To be continued…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.