SM 5 BSZ - Linux pc radio, flat frequency response by an extra digital filter.
(Oct 29 2000)

Hardware filter response

The first process of the Linux dsp radio is to convert the incoming signal from the time domain to the frequency domain. As a result the signal is obtained as a series of fourier transforms.

By feeding pulses into the system the amplitude and phase response of the entire dsp radio all the way to the fourier transforms can be measured with good accuracy.

By simply taking the inverse of this spectrum, averaged over many pulses to reduce influence of noise, the filter function that will produce an absolutely flat frequency response is obtained.

One extra loop is added in the first fft subroutine make_fft1(). This loop multiplies the fourier transforms by the inverse of the hardware frequency response multiplied by the desired frequency response specified by the operator.

Fig 1. Shows the frequency response of the direct conversion receiver using the IQ mixer and the anti alias filters and a Delta44 audio board. The input is the pulse generator used for calibration. The useful bandwidth is about 75kHz and the passband ripple is in the order of 0.5dB.


Fig 1. Frequency response of uncorrected direct conversion receiver at 7.050MHz. Note that a selective rf amplifier must be used to make pulses strong enough. In this case the rf amplifier is centered at 7.1MHz, causing a small asymmetry of the frequency response.


After running the calibration routine the frequency response is flat with parabolic fall off. The shape is precisely known so the waterfall graph can be calculated using that knowledge. Fig. 2 shows the spectrum and waterfall graph of the calibrated Linux dsp system.

Fig 2. Frequency response of corrected (=calibrated) direct conversion receiver at 7.050MHz.


The calibration routine

The first screen of the amplitude and phase calibration is shown in fig. 3. This screen is intended to make it easy to select amplitude and repetition rate of the pulse generator.


Fig 3. First screen of amplitude and phase calibration. Here the amplitude and repetition rate of the calibrate pulses should be set.


Once amplitude and repetition frequency are set the second screen is reached by pressing ENTER. The pulse repetition rate must not be changed after the first screen is left.

The second screen is shown in figure 4. Here the average pulse response is collected.


Fig 4. Second screen of amplitude and phase calibration. Collecting the average response of many pulses.


The second screen shows the complete frequency response including any previous calibration step. When the user decides that many enough pulses are averaged the next step of the calibrate routine is reached by pressing "U".


Fig 5. Third screen of calibration routine. Possibillity to manipulate the measured hardware response in both time and frequency domain. In this case data is valid all over the frequency range so the user should just press "A".


The third screen of the calibration procedure shown in fig. 5 allows the user to remove invalid data outside the frequency response of the hardware. With the 90kHz direct conversion receiver all points are valid so this screen is not used. The next screen is reached by pressing "A".

Figure 6, the fourth screen of the calibration routine allows the user to select the desired frequency response.


Fig 6. Fourth screen of calibration routine. The white curve is the desired response selected by the user. The yellow curve is the amplitude and the green one the phase response of the correction filter that must be used to provide the desired frequency response of the whole system.


Selecting a very wide flat range with rather steep fall off as is done in fig. 6 results in a pulse response that has rather strong oscillations on both sides of the pulse as is shown in fig. 7.

Fig 7. Pulse response of Linux dsp when calibrated as shown in fig. 6.


As a comparision fig.8. shows the pulse response of the uncalibrated system.

Fig 8. Pulse response of Linux dsp when uncalibrated. This is the response of the hardware with no digital correction.


It is possible to reduce/remove the oscillations in the pulse response by selecting a different, less flat, shape of the desired frequency response. In order to allow further processing to use MMX instructions it is nessecary to keep the flat region wide. Otherwise there are dynamic range problems because MMX uses only 16 bit integers for processing. The oscillations in the pulse response make the noise blanker more complicated but the extra computing is well motivated by the large time saving provided by use of MMX instructions.

The center discontinuity

The averaging of pulses shown in fig. 3. is done in the frequency domain. The amplitudes can be averaged directly but the phases have to be differentiated twice before they can be averaged. When integrating the average twice a discontinuity is obtained at the center because the A/D converters are not DC coupled.

The structure visible in fig. 3 at the discontinuity is not really the hardware response which is a very narrow notch. The notch is widened because the pulse repetition rate was 118Hz for this measurement. Therefore the window function used to pick out individual pulses contributes to the center notch and makes it wider.

The discontinuity causes ugly frequency response at the center frequency corresponding to very low frequencies in the I and Q signals of the pulse response.


Fig 9. Low frequency tails in I and Q caused by the center discontinuity.


The center notch provided by the hardware is very narrow and has a nice phase response. The best strategy is to not make any changes to it in the digital processing. There is a function allowing the user to interpolate across the discontinuity and replace it by smooth curves.

The center notch removal routine has 4 screens on which the user can select by how many terms the curve should be fitted to a polynomial. Figures 10 and 11 show one of these screens with 2 and 7 parameters respectively. The discontinuity is at the right side of the screen. The yellow curve is the current correction function, slightly curved and with the discontinuity at the right side. The white curve is the difference between the fitted polynomial and the correction function. 2 terms as in fig 10 is clearly not enough while 7 parameters are too many as can be seen by the large values and alternating signs of polynomial coefficients 6 and 8 in fig 11 having values 278.0 and -345.9 respectively. The procedure is uncritical, 2 and 7 terms produce nearly identical results although 4 or maybe 5 would be the optimum choice.



Fig 10. Polynomial fit with 2 terms.


Fig 11. Polynomial fit with 7 terms.


It is easy to find out how many terms to use. Just use + or - to select a reasonable y scale. Start with few terms and watch how the while line becomes less curved. With too many terms the curvature belonging to the center discontinuity will change slightly and that is not difficult to see accurately enough.

Fig. 12 is the fifth and last screen of the discontinuity removal routine. It shows the correction filter with the discontinuity removed. Fig. 13 shows the corresponding pulse response in the same scale as fig.9. Note that the low frequency components are absent and that the pulse is surrounded by high frequency oscillations only.


Fig 12. Final correction function with center discontinuity removed..


Fig 13. Pulse response of calibrated receiver. This is the same pulse response as shown in fig. 7, but the x and y scales are different to make the pulse tails visible and allow a comparison to fig. 9.