Lab 2. Impulse Response of a System

advertisement
Lab 2. Impulse Response of a System
Purpose
As a result of performing this lab, you will
•
•
use the unit impulse and unit step functions to characterize a system,
compare the theoretical impulse and step responses of systems to the effects which
occur when the impulse and step functions are applied to real circuits.
Introduction
The impulse response of a system is the circuit's output when the input is a unit impulse or
Dirac Delta function. In this lab you will examine a circuit's response to a unit impulse
input.
During the Prelab this week you will examine an RC and an RLC network. First you will
manually convolve a unit impulse with the RC network, then perform the same analysis in
MatLab, and finally, build1 a circuit in MicroSim's schematic editor to test the circuit. For
the RLC network you will test it with MicroSim.
During the lab period you will build and test the circuits which you modeled during the
Prelab.
In your report you will be expected to compare the results of your manual calculations,
the MatLab analysis, and the MicroSim simulation. You will also comment on the results
of the RLC network response.
Note: Starting with this lab, you will need to bring a blank diskette with you to class in
order to record the data for later analysis. Note: The data will be stored as ASCII data
which can be imported into MatLab, a spreadsheet, etc.
Prelab
Basis for seeking the Impulse Response of a System
Network
x(t)
X( ω)
h(t)
H(ω)
y(t)
Y(ω)
Figure 1. Transfer Function
1
UTD will supply integrated circuits and inductors, the student is expected to purchase resistors and
capacitors. See Introduction to Communications System Labs, page 4.
Page 1 of 8
Rev. C
We can find the output of this system using convolution:
y(t)=h(t) * x(t)2.
(Eqn. 1)
This equation can be solved using the convolution integral
y(t) =
∫ x( λ )h(t - λ ) dλ
.
(Eqn. 2)
In the frequency domain we can solve the problem using multiplication:
Y(ω)=H(ω)X(ω) .
(Eqn. 3)
Using the impulse response to characterize the channel gives us
x(t) = δ(t) .
(Eqn. 4)
X(ω) = F[δ(t)]
(Eqn. 5)
Y(ω) = H(ω).
(Eqn. 6)
When
we conclude that
Prelab 2.1 Convolve a unit impulse with an RC network:
Figure 2. RC Network
In this circuit, x(t) is V1, a unit impulse function. The resistor and capacitor comprise
h(t). Using the component values shown, find y(t), the output of the circuit. Plot y(t)
and Y(ω). Perform the convolution without the aid of software tools.
Prelab 2.2 Model the RC Network using MatLab
1. Use MatLab to determine the output of the same RC network You have learned how
to generate pulses in MatLab. For this lab, you may find the pulses you generated in
Lab 1 helpful. To see a response which closely approximates an impulse response,
you must modify the pulse to make the pulse duration as short as possible. (Assume
that all input and output data is analog – this is not an experiment in digital signal
processing.)
2
In this procedure * represents the convolution operation.
Page 2 of 8
Rev. C
You can use
>> imp = [1 zeros(1,99)];
as the unit impulse for MatLab simulation.
Set the amplitude of the pulse to 5 volts,
You can simulate the convolution by using the conv or the filter function in MatLab:
>> y = filter ( h, 1, imp) ; or
>> y = conv ( h, imp )
where h is h(t), the transfer function of the network, and imp is x(t), the input impulse.
Show plots of the amplitude vs. time and phase vs. frequency.
2. Perform an FFT on y(t) to find Y(F), using
>> Y = fft ( y ) ;
3. Plot the frequency response of the network (amplitude vs. frequency).
Prelab 2.3 Simulate the RC Network using MicroSim.
Build the circuit using MicroSim Schematic editor. Test the circuit with an AC sweep.
Set the AC Sweep Type to decade, the number of data points to 1001 points per decade,
a start frequency of 10 Hz, and an end frequency of 1 MHz (you may have to enter this
value as 1000k). Using Probe, create a plot showing the output voltage versus frequency.
Then, still using Probe, select FFT and create a plot of output voltage versus time.
Prelab 2.4 . Find the impulse response of the system using the IFFT
In section 2.2 you found the frequency response of the RC filter. To demonstrate the
inverse Fourier Transform, perform an inverse Fourier Transform on the data using
MatLab's IFFT function. You should find the same impulse response. In your report, plot
the responses and compare them with the responses that you found in Prelab 2.3.
Prelab 2.5 The impulse response of an RLC network
Build an RLC circuit using the MicroSim editor. For component values, use R = 1 KΩ, C
= 0.022 µF and L = 56 µH. A schematic is shown in Lab section 2.2. As in Prelab 2.2,
test the circuit with an AC sweep and generate voltage/frequency and voltage/time plots.
Page 3 of 8
Rev. C
Lab 2. The Impulse Response of a System
Lab Period
Components needed for the Lab period are
Resistors:
1 – 3.3 KΩ
1 – 1 KΩ
Capacitors:
1 – 0.022 µF
Inductors:
1 – 56 µH
For this lab you will use the following test equipment:
Signal Generator
Oscilloscope
PC running LabView software
Set the function generator to the following initial settings:
⇒
⇒
⇒
⇒
⇒
⇒
Square wave
Frequency: 1 kHz
Amplitude: 10 Vpp (actual)
Duty cycle: 20%
Burst mode: (Enter this mode by pressing "Shift" "Burst")
Offset voltage: 5 Vdc (actual)
Verify that the waveform from the function generator is a train of very narrow positive
pulses. This type of waveform will allow us to simulate the impulse function to be applied
to the any arbitrary system, in this case an RC network and an RLC network.
Lab 2.1 THE INPUT SPECTRUM
1) Use "Autoscale" and verify that the waveform from the function generator is a train of
very narrow positive pulses. Select "Time" and then "Duty Cycle". Record this value.
Also, record the duration of each pulse by pressing "Next Menu" and then "+Width".
This type of waveform will allow you to create an approximation to the impulse
function to apply to the circuit.
Duty cycle:
Pulse width (τ):
Frequencies (1/τ) at which zero crossings occur:
2) Use the FFT (as in Lab 1) to verify that the spectrum of the signal is sinc shaped. Use
the cursors to measure the frequencies of the zero crossings displayed by the
oscilloscope. You might need to use "Autoscale FFT" to properly display the
Page 4 of 8
Rev. C
spectrum. Compare this data with that obtained in the previous step. Note: This is the
actual input spectrum which will be applied to the circuit.
First zero crossing frequency:
Second zero crossing frequency:
3) On the PC, start LabView and load the file WAVEFFT.VI. Configure WAVEFFT.VI
by entering 20E-3 for the "Time span". (Save your data files (i.e. write to
A:\<filename>)). Click on the button with the arrow to execute the VI. If you want
to make a copy of the screen display, from the "File" menu, select "Print window..."
and then "OK".
In your report:
1) What value should τ have in order to apply a true train of impulses?
2) Describe the waveform in the frequency domain when the time domain input is a train
of impulses.
Lab 2.2 The Impulse Response and Transfer function of an RC Circuit
1) Construct the circuit shown in Figure 2, using the values shown in the schematic:
R=3.3 K, C=0.022 µF. Connect the function generator to the input and the
oscilloscope (channel 1) to the output. On the oscilloscope, select "Autoscale", then
set the "Time/Div" to 100 microseconds/division. Select "Main/Delayed" and then
select "Lft" under "Time Ref". The display should approximate the impulse response
of the RC circuit. In your report, compare this display with the display obtained in the
Prelab.
2) Use the FFT function of the oscilloscope to display the circuit's output spectrum. Set
the effective sampling frequency to 50 KSa/s. To eliminate the time domain trace
from the screen, press the "1" button twice. The displayed spectrum is an estimation
of the transfer function of the circuit.
3) Record this transform pair using WAVEFFT.VI (LabView). For the value to enter for
"Time span", use 1E-3. Note: When you save these files, do not forget to rename
them so you do not overwrite previously saved data. Again, you may print the plots as
described in Lab 2.1 section 3.
4) Notice that with the "Time span” set to 1E-3, the time resolution is enhanced, but the
frequency resolution is poor. To improve the frequency resolution, increase the time
span to 20E-3. Note: Rename the files before you save them. Again, you may print
the plots as described in 3 above.
In your report:
1) Explain the effect of the RC network on the high frequency components of the input
signal.
2) Estimate the slope of the output spectrum over the range of 0 Hz to 7.5 kHz.
Page 5 of 8
Rev. C
3) Determine the ratio between the input and output spectra. To better estimate the
transfer function of the RC circuit, use MatLab or a spreadsheet to analyze your data.
A sample MatLab file is available on the CommLab web site as transfer.tem. If you
convert the data to absolute numbers (volts) the formula will be
Output
.
Input
If you use the data in dB (as saved by WAVEFFT.VI), use
Output – Input.
4) Record any other observations you made during this procedure which you consider
significant.
Lab 2.2 The Impulse Response of an RLC circuit
Figure 3. RLC Circuit
1) Reset the oscilloscope and the function generator. Use the following function
generator settings:
⇒
⇒
⇒
⇒
⇒
⇒
Square wave
Frequency: 100 kHz
Amplitude: 5 Vpp
Duty cycle: 20%
Burst mode: (Enter this mode by pressing "Shift" "Burst")
Offset voltage: 2.5 Vdc
Measure τ as in Lab 2.1:
Pulse width (τ):
Frequencies (1/τ) at which zero crossings of the sinc spectrum occur:
2) Use the FFT to display the frequency spectrum of the signal. Set the scope to an
effective sampling rate of 5 MSa/s. Using the cursors, measure the frequencies of the
Page 6 of 8
Rev. C
zero crossings displayed by the oscilloscope. In your report, compare this data with
that obtained in step 1.
First zero crossing frequency:
Second zero crossing frequency:
3) Record this transform pair using the WAVEFFT.VI in LabView. Use 0.2E-3 for the
"Time span". (Filename? Print?)
4) Construct the circuit of Figure 3 using the component values shown (R=1K, L=56 µH,
C=0.022 µF). On the oscilloscope, select "Autoscale", then set the "Time/Div" to 20
microseconds/division. Select "Main/Delayed" and then select "Lft" under "Time
Ref". If the waveform trace is unstable, adjust the trigger level by rotating the "Level"
knob in the "TRIGGER" section of the oscilloscope. The display should approximate
the impulse response of the RLC circuit.
5) Use the FFT of the oscilloscope to display the output spectrum (an estimation of the
RLC circuit transfer function). Autoscale the FFT and then set the display using the
following settings:
⇒ Effective sampling rate = 5 MSa/s
⇒ Freq Span = 305.2 kHz
⇒ Cent Freq = 151.4 kHz. (if necessary, depress the soft key "Move 0 Hz to Left"
to make this setting)
6) We may think of the RLC circuit as a band pass filter. Using "Cursors" and "Find
Peaks", determine the center frequency of the filter. Also, determine the two -3 dB
(half power) frequencies. Set V1 at the maximum amplitude of the spectra (make V1
the active cursor and use "Find Peaks") and move V2 -3 dB below V1. Set f1 and f2 at
the intersections of V2 and the spectrum. From this data determine the bandwidth of
the filter and the Q-factor3 (explained below).
Center freq:
Lower -3 dB frequency, fl:
Upper -3 dB frequency, fu:
Bandwidth = fu-fl:
Q factor = center frequency/bandwidth:
7) Use WAVEFFT.VI to record the time and frequency responses. Use 0.2E-3 for the
"Time span". Before you print the LabView data, you may find it helpful to zoom in
on the frequency domain display by resetting the maximum frequency to 300 kHz (by
clicking on the highest frequency value in the lower right corner of the graph, and then
entering the new value).
QUESTIONS
3
Q-factor will be explained in class when band pass filters are taught.
Page 7 of 8
Rev. C
1) Determine the ratio between the input and output spectra over the range of 0 to 300
kHz.
2) Calculate (manually) and plot the transfer function of the circuit and compare your
calculations with the data obtained in question 1.
Hint: You can improve the plots of the time and frequency data recorded by WAVEFFT
by post-processing the data using MatLab or a spreadsheet. A sample MatLab script
for post-processing is Transfer.m, stored as transfer.tem at the CommLab website.
Report
1) For the RC circuit, compare the data you obtained in the Prelab with the data you
collected in the lab. Make sure you compare all relevant data, explaining any
discrepancies you observed.
2) Explain the data you collected for the RLC circuit. As mentioned in Prelab 2.5, you
can simulate this with MicroSim and/or MatLab. If you performed a simulation,
compare the data collected from the simulation with the data collected in the lab.
3) Answer all questions from the Lab and Prelab.
4) Based on the procedures used in this lab, explain how you would determine the
transfer function for an unknown circuit.
Page 8 of 8
Rev. C
Download