This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Fourier Analysis & Discrete-time Systems
Road map – looking backwards Continuous-time signals & systems
Ordinary differential equations Integrating factors, variation of parameters
State-space and vector ODEs
Zero-input response + zero-state response
Impulse response, step response
Convolution
Laplace transform methods
Transfer functions, poles, zeros
Partial fraction expansion
Frequency response, sinusoidal steady-state, Bode diagrams Filtering; lowpass, highpass, etc
The remarkable symmetry between forward and inverse Fourier transforms means that convolution in one domain (time or frequency) corresponds to multiplication in the other domain
In digital signal processing, we often use a technique known as windowing
These involve time-domain multiplication Check out matlab doc on ‘window’
For computer use we need to sample signals Most commonly this is periodic sampling every T seconds we take a sample of the continuous signal This yields a sequence
A continuous-time signal is a function of time t A discrete-time signal is a sequence indexed by t
T is the sampling period (sec)
1/T is the sample rate (Hz)
Often we also quantize the samples to yield a digital signal of a fixed number of bits representation
This is a subject for the next course
MAE143A Signals & Systems Winter 2013 26
xn = x(nT )
Analog-to-digital conversion
Signal conditioning Filtering (anti-aliasing), offset, ranging
Track and hold circuit Enabled by the rising edge trigger Holds the signal at the latched value
Analog-to-digital converter Converts held signal to 8-bit, 16-bit, 24-bit digital
If the continuous-time signal is bandlimited to B and we sample faster than the Nyquist frequency
Then we can exactly reconstruct the original signal from the sample sequence
Conversely: if we sample at or more slowly than the Nyquist frequency then we cannot reconstruct the original signal from the samples alone
We might have other information that helps the reconstruction. Without such extra information we suffer from Aliasing – some frequencies masquerading as others
MAE143A Signals & Systems Winter 2013 37
Aliasing
Sampling rate is less than the Nyquist rate Spectra overlap in sampled signal Impossible to disentangle
Signals from above ωs/2 masquerade as signals of a lower frequency
This is what happens to wagon wheels in western movies
fs=30Hz but the passing rate of the spokes is greater than this
Dopplegänger and impersonation
Alias: a false or assumed identity
Samuel Langhorne Clemens alias Mark Twain
5.5KHz sampled at 10KHz a.k.a. 4.5KHz
MAE143A Signals & Systems Winter 2013 38
Aliasing II
MAE143A Signals & Systems Winter 2012 39
Dealing with aliasing
Anti-aliasing filters Before we sample a signal x(t) at fs we lowpass filter it through a filter of bandwidth B!fs/2
This is straightforward but not simple 1. An ideal lowpass filter has non-timelimited
non-causal response 2. A timelimited signal has a Fourier transform of
unbounded support in frequency 3. We can only approximately lowpass filter
1. We need to worry about roll-off near fs/2
2. We have to back off from fs/2
3. Fast roll-off is accompanied by passband ripple
You cannot remove aliasing after sampling
MAE143A Signals & Systems Winter 2013 40
Aliasing in practice
Any data-logging equipment worth a dime has anti-aliasing filtering built in
It is switched in at sample-rate selection time and is handled by the equipment software
DSpace, LabView, HP analyzers Often this (and timing questions) limits the available sampling rates High-performance data acquisition is an art The data quality near Nyquist is dodgy
So why do we need to know about aliasing? Because of the mistakes you can/might/will make!!
MAE143A Signals & Systems Winter 2013 41
Downsampling scenario
An email arrives containing two columns of data sampled at 44.1KHz
You look at it and figure that it is oversampled and that most of the interesting information is in the range less than 10KHz in the signal
This would be captured by data sampled at 22.5KHz
So you toss out every second sample Now it is the same data sampled at half the rate
Let us try this out with a former Hilltop High student
MAE143A Signals & Systems Winter 2013 42
Downsampling
MAE143A Signals & Systems Winter 2013 43
Original data at 44.1KHz
Downsampled data at 22.05KHz
Decimated data at 22.05 KHz
Difference at 22.05 KHz Between downsample and decimate
Decimation instead of downsampling
The mistake earlier was that the reconstructed content of the 44.1KHz data contains signals in the range 0-20KHz roughly
Downsampling to 22KHz and then reconstructing should yield signals in the 0-10KHz range
The 10-20KHz material has been aliased into 0-10KHz
Before downsampling we should filter the data with a lowpass digital filter of bandwidth ~10KHz
This is called decimation
MAE143A Signals & Systems Winter 2013 44
Matlab’s ‘decimate’
MAE143A Signals & Systems Winter 2013 45
>> help decimate decimate Resample data at a lower rate after lowpass filtering. Y = decimate(X,R) resamples the sequence in vector X at 1/R times the original sample rate. The resulting resampled vector Y is R times shorter, i.e., LENGTH(Y) = CEIL(LENGTH(X)/R). By default, decimate filters the data with an 8th order Chebyshev Type I lowpass filter with cutoff frequency .8*(Fs/2)/R, before resampling. Y = decimate(X,R,N) uses an N'th order Chebyshev filter. For N greater than 13, decimate will produce a warning regarding the unreliability of the results. See NOTE below. Y = decimate(X,R,'FIR') uses a 30th order FIR filter generated by FIR1(30,1/R) to filter the data. Y = decimate(X,R,N,'FIR') uses an Nth FIR filter. Note: For better results when R is large (i.e., R > 13), it is recommended to break R up into its factors and calling decimate several times.
Matlab’s ‘downsample’
Downsampling is asking for trouble with physical signals It is a common mistake made by people
It is not really forgivable though No graduate of MAE143A has ever admitted to me to making this mistake
MAE143A Signals & Systems Winter 2013 46
>> help downsample downsample Downsample input signal. downsample(X,N) downsamples input signal X by keeping every N-th sample starting with the first. If X is a matrix, the downsampling is done along the columns of X. downsample(X,N,PHASE) specifies an optional sample offset. PHASE must be an integer in the range [0, N-1].
Scaled to hide the sample time T dependence Periodic in Ω with period 2π Nice properties but not really useful
For timelimited discrete-time signal x[n], n=0,…,N-1 define the Discrete Fourier Transform (DFT)
MAE143A Signals & Systems Winter 2013 47
X(Ω) =∞
n=−∞x(nT )e−jnΩ = Xs(ω)|ω=Ω
T
Xk =N−1
n=0
x[n]e−jk 2πN n, k = 0, 1, ..., N − 1
x[n] =1
N
N−1
k=0
Xkejn 2π
N k, n = 0, 1, ..., N − 1
Discrete Fourier transform
DFT: N signal samples in and N transform values out Related to DTFT
Inverse DFT: N in values and N time samples out N is referred to as the record length If x[n] is real then
MAE143A Signals & Systems Winter 2013 48
Xk =N−1
n=0
x[n]e−jk 2πN n, k = 0, 1, ..., N − 1
x[n] =1
N
N−1
k=0
Xkejn 2π
N k, n = 0, 1, ..., N − 1
Xk = X(Ω)|Ω= 2πkN
X−k = Xk
Interpretation of the DFT
N-sample data record
Periodic repetition – forever What is the Fourier series?
Period of this repetition is NT
MAE143A Signals & Systems Winter 2013 49
x0, x1, . . . , xN−1x0 x1x2
xN−1
T 2T (N-1)T 0
time time
x0 x0x0
… … period NT period NT period NT period NT
xrep(t) =∞
k=−∞cke
jk 2πNT t ck =
1
NT
NT−
0−xrep(t)e
−jk 2πNT t dt
xrep(t) =∞
n=−∞x[n mod N ]δ(t− nT )
Interpretation of the DFT
Repeat the N samples Periodic time-unlimited
Compute Fourier series – it is a periodic signal
This is the k-th DFT coefficient
ck is periodic in k with period N
MAE143A Signals & Systems Winter 2013 50
xrep(t) =∞
n=−∞x[n mod N ]δ(t− nT )
ck =1
NT
NT−
0−xrep(t)e
−jk 2πNT t dt =
1
NT
NT−
0−
N−1
n=0
x[n]δ(t− nT )e−jk 2πNT t dt
=1
NT
N−1
n=0
x[n]
NT−
0−δ(t− nT )e−jk 2π
NT t dt =1
NT
N−1
n=0
x[n]e−jk 2πN n
=1
TXk
The Discrete Fourier Transform
The DFT of an N-sample (real) signal record is an N element (complex) transform record is the Fourier series of the periodic (sampled) signal repeated over and over again in both directions is N-periodic in frequency bin (k)
We cannot resolve frequency more finely because there is only N data The frequency data have a conjugate relation Plotting |Xk| is a line spectrum as if the data were N-periodic
MAE143A Signals & Systems Winter 2013 51
X−k = Xk
Sunspot example from the Kamen & Heck book
Go to: http://sidc.oma.be/index.php3 Monthly sunspot data since 1749
Edit the file to remove leading and trailing rows with ‘*’ or fewer columns than four