Le02_SignalProcessing.pdf

TMMS04
Lesson 2 – Signal Processing
2014 HT-1
1. This task will demonstrate aliasing when sampling the sinus wave shown in Figure 1.
Sinus at 9 Hz
1
0.8
0.6
Value [−]
0.4
0.2
0
−0.2
−0.4
−0.6
−0.8
−1
0
0.1
0.2
0.3
0.4
0.5
Time [s]
0.6
0.7
0.8
0.9
1
Figure 1: y = sin(2π 9 t + π)
(a) Sample the signal manually with a sample rate of 10Hz. Mark each samples with a cross. The
cross mark samples will form a lower frequency sinus wave. What is its apparent frequency?
(b) Do the same thing, but this time sample at 12Hz. Mark the new samples with some other
symbol. What frequency does the new samples seem to indicate?
(c) Comment on the two different sampled curve frequencies. How do they relate to the sample
frequency, Nyquist frequency and folding.
(d) If a 60Hz sinusoidal signal is sampled at 100Hz, is there risk for aliasing? Why?
(e) If a 50Hz sinusoidal signal is sampled at 200Hz, is there risk for aliasing? Why?
2. Figure 2 shows the amplification and phase shift of a low-pass filter.
Bode Diagram
Magnitude (dB)
0
−10
−20
−30
Phase (deg)
−40
0
−45
−90
0
10
1
10
2
10
Frequency (rad/s)
3
10
4
10
Figure 2: Amplification and phase shift of a low-pass filter
1
TMMS04
Lesson 2 – Signal Processing
2014 HT-1
(a) What is the “order” of the filter in Figure 2? Determine the filter’s corner frequency (sometimes also called cut-off frequency or break frequency) ωc , the amplification and the phaseshift at that frequency. Hint: Recall the asymptotic approximation of Bode plots.
(b) What is the filter transfer function G (s) in the frequency plane?
Calculate the filter amplification at the frequency ω = 5.0 ωc .
3. For the following questions assume an ideal low-pass filter. An ideal low-pass filter is a simplification of real filters like the one in the question block before. An ideal low-pass filter eliminates
all frequency components above the cutoff frequency while leaving those below unchanged.
(a) Assume that the low-pass filter will be used as an “anti-alias” filter in a digital control system.
Calculate the highest allowed cutoff frequency ωc in rad
s when the control system sample time
period is T = 50ms.
(b) Assume that the bandwidth in a control system is ωb = 32rad/s. How should the sample
frequency ωs and the “anti-alias” filter cutoff frequency be adapted to the bandwidth?
4. A signal containing three distinct frequency components and noise is shown in Figure 3. This is
similar to the signal in the last question in lesson 1, except that the frequency has been increased.
By the use of fast Fourier transform FFT, a frequency spectrum for the signal has been created.
It is shown in Figure 4.
2
1.5
Signal
1
0.5
0
−0.5
0
0.5
1
1.5
2
Time [s]
2.5
3
3.5
4
Figure 3: This signal contains three major signal component at different frequencies as well as noise.
Periodogram Using FFT
10
0
Power/Frequency (dB/Hz)
−10
−20
−30
−40
−50
−60
−70
−80
0
2
4
6
8
10
Frequency (Hz)
12
14
16
18
20
Figure 4: The frequency spectrum for the signal in Figure 3.
2
TMMS04
Lesson 2 – Signal Processing
2014 HT-1
(a) In Figure 3, draw the “curves” for the two lowest frequency signal components.
(b) Design a first-order high-pass filter that preserves the highest frequency component (transfer
function). What will the amplification for that frequency be? Sketch the Bode plot of this
filter by asymptotic approximation.
(c) Design a first-order low-pass filter that preserves the constant level of the signal. What
will the amplification for the middle frequency component become? Approximately what
amplitude will the suppressed “middle frequency” sinus have? Sketch the Bode plot of this
filter by asymptotic approximation.
(d) Now try to use a second-order low-pass
filter with the same corner frequency on the following
√
2
form, with the damping factor ζ = 2 .
1
s
ωc
2
(1)
+ 2ζ ωsc + 1
Now what will the amplification be for the middle frequency signal component. Is this
better then in the first-order filter case? Sketch the Bode plot of this filter by asymptotic
approximation.
5. (a) Create a simple band-pass filter transfer function by cascading (multiplying) a low-pass and
a high-pass filter of the first order. Write your answer on the following form, where ωc , ωcx ,
and ζ are combinations of ωcl and ωch .
GBP (s) = s
ωcx
s
ωc
2
(2)
+ 2ζ ωsc + 1
Sketch the Bode plot of this filter by asymptotic approximation.
(b) Choose high and low corner frequencies to isolate the “strongest” signal component in the
PSD in Figure 5. What is the approximate amplification (suppression) at the three strongest
frequency components with your selection? Sketch the Bode plot of this filter by asymptotic
approximation.
Periodogram Using FFT
20
Power/Frequency (dB/Hz)
10
0
−10
−20
−30
−40
−50
−60
0
50
100
150
200
250
Frequency (Hz)
300
350
400
450
500
Figure 5: Frequency spectrum of signal from a sensor affected by vibrations. Luckily the lower
frequency span containing the desired signal is relatively clean.
6. The A/D-converter in Figure 6 has a resolution of 8 bits. And the analog input port has a voltage
range 0-10V. Hint: Do the job graphically with 2 bit before.
3
TMMS04
Lesson 2 – Signal Processing
US
Analog signal
0 - 10 V
Anti-alias
LP-filter
Sample
and
Hold
Analog/Digital
Converter
2014 HT-1
Digital
signal
Figure 6: The signal processing chain for reading and converting an analog signal into a measurement
system (computer).
(a) What is the digital output signal resolution (expressed in Volts)?
(b) What is the binary output value from the ADC when the input signal is 7.0V.
(c) What is the binary output value from the ADC when the input signal is 9.96V.
(d) Determine the required ADC resolution in number of bits if you want to be able to distinguish
a difference ∆Us = 0.001V on the analog input signal.
7. Usually filtering prior to sampling is used to remove high frequent noise in a signal (Anti-alias
filtering). Additional filtering might, however, be required in software for further more advanced
signal processing. The faster a computer is, the more processor cycles are available each second
for calculations. The amount of cycles is, however, discrete and that is why a software filter in
the form of a continuous transfer-function needs to be transformed into a time-discrete version.
(a) Use bi-linear transform (Tustin’s method), (4), to transform the first-order low-pass filter (3),
into its time-discreet version.
1
GLP (s) = s
(3)
ωc + 1
s=
2 z−1
T z+1
(4)
(b) Realize this z transfer function in an equation suitable for usual programming languages.
The equation shall show how to calculate the current output value based on the current and
past input values and past output values. Note! z −1 means one time step delay.
8. Comprehension questions
(a) Filters can be implemented in software, so called discrete filters. Is it possible to implement
anti-aliasing filter as such discrete filter or is it inevitable to implement them in analog
technology, e.g. with operational amplifier, capacitor, and so on? Justify your answer.
(b) Is it possible to prevent aliasing entirely? What are the consequences?
(c) In which trade-off do you run into when designing anti-aliasing filter for feedback control?
What is the difference to a pure measurement?
Hint: Phase shift of the filter.
GLP1 (s) =
GHP1 (s) =
s
ωc
1
+1
first order transfer function with low-pass
characteristic
s
ωc
s
ωc
GLP2 (s) = first order transfer function with high-pass
characteristic
+1
1
s
ωc
2
+ 2ζ ωsc + 1
second order transfer function with lowpass characteristic
Table 1: Cheat Sheet
4