signal processing notes
going from continuous to
sin(x)/(x) and its properties
polyphase filter banks
gaussian width after convolving 2
Converting spectrum back to rms volts
||sample time (time between samples)
|sampling frequency (1/ts)
nyquist frequency fs/2=1/(2*ts)
||total number of time samples used.
|frequency resolution: 1/(ts*N)
# of independent samples: N/2 . If complex samples are taken then each
complex number is two independent numbers so there will be N
||x(t) is the time series, X(f) is the FT of x(t)
|if m,j are indices of sets (say to sum over), then M,J will
number of elements in the respective sets.
The continuous FT of the function x(t) is: X(f)=
Going from a
to discrete fourier transform: (top)
When going to the discrete, finite case of N samples we get:
since the samples are spaced by ts.
The FT becomes:
f=> k/(ts*N) k=0..N-1. N/2
samples are duplicated for real input samples.
* dt) n=0..N-1 or
If we agree that Xk is in steps of our frequency resolution:
1/(tsN), that xn are the time points
at n*ts , and that dt is our unit of time then we can
the equation to:
* dt) n=0..N-1 .
Xk = sumn(xn*exp(2*pi*i*kn/N))
When you transform a data set of N points (with no
windowing) then you are weighting the data time points with 1 and all
time points with 0. This is a boxcar window of duration N.
is the transform of a boxcar window.
sin(x)/x and its
To show that sin(x)/x is the FT of a boxcar
we integrate the window from -T/2 to T/2 (to make it
so the anit-symmetric imaginary part goes to zero):
The imaginary part is odd so it integrates to 0. The real part
X(f)= 1/(2*pi*f) * [ 2*sin(2*pi*f*T/2)] =
T* ( sin(pi*f*T)/(pi*f*T)
If we change to the discrete format:
Xk=N * sin(pi*(k/N)*N)/(pi*k/N*N) =
The zeros of sin(x)/x are at:
zeros: sin(x) = 0 at x=(n+1)*pi (n=0..)
The extrema of sin(x)/x are found by differentiating and setting it to
d/dx (sin(x)/x) = (cos(x)/x - sin(x)/x^2)=0
Tan(x) goes to infinity at x=(2n+1)*pi/2. As x goes to infinity the
must approach (2n+1)pi/2 so for large x this is a pretty good
for the peaks. Looking at (sin(x)/x)^2 (the power) the difference
(2n+1)*pi/2 and the correct value is: (1st: .2 db, 2nd: .07db, 3rd:
x^2*cos(x)=x*sin(x) or x=tan(x)
plot for (x>0) has a linear plot of the voltage on top and
db plot of the power (sinx/x)^2 below. Since both sin(x) and (x) are
symmetric in (x), sin(x)/x is symmetric and x<0 is the same as
The first sidelobe is -13.26 db down in power from
the peak. The values for the first 14 power sidelobes are printed on
A filter bank will take a single bandwidth BW and
it into K narrower channels BN. If K is 1 then the filter bank is a
The simplest multi channel filter bank is created
by fourier transforming (FT) the data. We take K input points and
a FT. This uses a boxcar window in the time domain. The convolution
tells us that this will convolve the channels in the frequency domain
sin(x)/x is the FT of a boxcar window). After computing
the FT we need to square the data to compute the power in each channel
BNk. The zeros and maxima of sin(x)/x and (sin(x)/x)
^2 are shown above.
The individual filters BNk (k=0,K-1)
have a width that depends on how the filter bank was constructed. The
BNk will have some overlap with adjacent filters. When
a strong signal falls in filter BNj, it will also appear
always) at a reduced level in BNk. This overlap in response
is called the filter leakage. The polyphase filter technique allows you
to decrease this leakage at the expense of taking larger time
straightforward way to decrease filter leakage.
The easiest way to decrease the filter leakage is to
compute a spectra with more frequency resolution than needed, and then
smooth and decimate this spectrum to the desired resolution. To be more
specific lets assume that we want 1024 frequency channels on output. To
get better frequency resolution you need to take a longer run of data.
Instead of 1024 points lets take 4096 points (4 times the needed
We do a 4096 point FT to go to the frequency domain. We then define a 4
point filter that will be used to smooth the 4096 points spectra and
the filter leakage. After smoothing we can then decimate every 4th
to get back to the desired resolution. Writing this out using * as the
convolution operator, x for mulitiplication, C4 for the 4
coefficients, y(t) as the 4096 time points, and Dn for
by n we get:
D4(FT4096(y(t)) * C4
A little harder but quicker:
Since the FT is a linear operation we can
of doing the smoothing/decimating operation before the FT. The
(in the frequency domain) is a convolution so it becomes at multiply by
the FT of C4 in the time domain. This is just a slowly
varying function of time (since there are no high freq components with
only 4 coefs). The decimation by 4 is a multiply by a set of delta
spaced by 4 points. In the time domain this becomes a convolution by
functions spaced by 1024 points. Writing this out and using c4096
as the 4096 transform of C4 , and Delta1024 as a
set of delta functions spaced by 1024 points we get:
(y(t) x c4096 ) * Delta1024
. After doing this we have our 1024 points (still in the time
with the requested bin shape. We then do a FThh1024
to go the the frequency domeain.
Convolving two gaussians together gives a gaussian
a larger width. The plot shows how the gaussian
width changes as a function of the input gaussians relative
convolving 2 gaussians (top)
Converting spectrum to rms volts. (top)
Given a spectral density function (spectrum) compute
what the rms input voltage was. This was done for a sine wave and noise
(generated on the computer). This is handy when you want to know the
rms counts at a digitizer given the average value of the spectrum. The
spectrum was computed from the fft using N=4096 pnts and the "forward
= (abs( 1/N*St(v(t)*exp(-2pi*f*t/N)))^2
the forward fft is getting divided by 1/fftlen in the idl
The data was set so that the rms value was 10 counts. Below i
refer to I and Q. These are the inphase (Real) and Quadrature
The plots show going from
spectrum back to rms volts (.ps) (.pdf):
- Page 1 Sine wave:
- Top input voltages. Black is realI, red is imaginaryQ. Each has
an rms of 10 and an amplitude of 14.1 (sqrt(2)*rms).
- 2nd: power spectrum. All the power is in rmsI=
avgSpectralPower*numspcChan)channel 16 (count from 0). The value 200=
2*rms^2. This comes from:
- pwr=rmsI^2 + rmsQ^2= 2*10^2.
- 3rd: input voltages with real rms of 10 and imaginary=
rms of 0.
- 4th: power spectrum from 3. The power is now in 2 bins (+/-16).
- single channel=50
- total power=100 = rmsI^2
- Page 2 Noise:
raw voltage samples.
- Black is realI, red is imaginaryQ. Both have an rms of 10.
- 2nd: spectrum of I,Q data. I averaged 1000 spectrum to decrease
the noise on the spectrum.
- Mean spectral value: .05
- Total power= 200 = rmsI^2 + rmsQ^2
- 3rd: raw voltage samples for I, Q=0.
- bottom: spectrum for rmsI=10, rmsQ=0
- Mean spectral value: .02
- Total power=100 = rmsI^2 +rmsQ^2 = 100 + 0.
- TotalPower = rmsI^2 + rmsQ^2 = 2*rmsI^2 (if rmsI=rmsQ)
- rmsI or rmsQ =
sqrt(TotalPower/Ndig) .. where Ndig is the
number of digitizer (I,Q) with signal.
- The important quantity is the rmsVoltage. If you have a sine wave
then the rmsVolt=sqrt(2)*sinAmplitude.
- When using the forward transform, the spectra get divided by
1/spclen. This is done by the idl routine.