#### Re: Waterfall display slightly offset from actual signal strength display

Neil Smith G4DBN

On my main waterfall screen, I have this, showing 11.7 Hz per point (what I called FFT bin size): and on the IF screen on my SW2, is says 2.9 Hz/point

The fast fourier transform calculation takes the full bandwidth of the digital stream coming from the FPGA front end and makes a calculation of the amount of energy in a specific frequency range (the "bin size" I mentioned) over a specified time period.  The math(s) behind it is one of the wonders of the world. There are subtleties around the overlap with adjacent bins.

Usingf MATLAB or Octave, you can play with the parameters, but a simple example is if you generate a couple of tones at 50 Hz and 120 Hz, then add noise, like this:

Fs = 1000;            % Sampling frequency
T = 1/Fs;             % Sampling period
L = 1500;             % Length of signal
t = (0:L-1)*T;        % Time vector
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
X = S + 2*randn(size(t));
plot(1000*t(1:50),X(1:50))
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('t (milliseconds)')
ylabel('X(t)')

you get a signal like this: and it is hard to see the two frequencies from that time-domain signal.

However, if you run a fast fourier transform on the signal at the sampling rate, you can calculate the amount of signal in each increment of frequency:

Y = fft(X);

P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);

f = Fs*(0:(L/2))/L;
plot(f,P1)
title('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')

and you end up with a spectrum that you can use to create the intensities of the display on one line of a waterfall.  The size of each bin depends on how fast you are taking the samples.  The faster you sample, the wider each bin becomes.

The whole subject area is fascinating, and the math(s) gets intricate, although the solutions in sotware have probably had more academic effort expended on improving the speed and efficiency of processing than almost any other set of algorithms.

I'm sure someone who knows this stuff better could offer a more cogent explanation.  There is a nice fun read at https://www.analog.com/media/en/training-seminars/design-handbooks/Software-Defined-Radio-for-Engineers-2018/SDR4Engineers_CH02.pdf if you have a spare couple of hours!

Neil G4DBN On 23/05/2021 16:41, Ron Hunsicker via groups.io wrote:
Neil, thanks, an explanation that I found interesting--"Oh, that's why it does that!"

For what I do, other than looking odd at high resolution, the offset creates no difficulty.  In AM mode, it really does not matter and in sideband I tune by ear.  (What's the likelihood that my 7 parts in 10 million is more accurate than the frequency control of their machine?)

If you are willing to continue to be helpful, what is an "FFT bin?"  The vertical lines in the graphical part of the IF display?  Something else?

Ron

p.s., I'm a "math, science, and engineering guy," not a "maths, science, and engineering guy!"
```--
Neil
http://g4dbn.uk```