It can be done i Octave as well, it is free.
(This is a homework assignment which i could use some help with, especially what to do in matlab)
Fourier series representation of periodic pulse train signal and filtering through LP filter.
We have an analog periodic signal that consists of positive rectangular pulses. The amplitude is
2 V, the width of each pulse is 2 ms and the period time is 4 times as large as the pulse width, ie 8
ms. One pulse is centered around the origin (time t = 0). Outside the pulses is the amplitude
zero.
This signal is sent through an unloaded RC low-pass filter with a buckling frequency equal to 500 Hz,
and you should examine how the output signal turns out. The filter is described with its
frequency response (in the frequency domain with the Bode diagram), so you have to divide the input signal into frequency components (Fourier series), calculate how each frequency component
is affected by the filter, and then sums the frequency components on the output (superposition principle).
a) Draw a figure for the rectangular pulse train (on paper) and calculate the letter expression by hand
for the Fourier coefficients. Insert the expression of the coefficients into the summation so that you
sees the entire letter expression for the Fourier series of the rectangular pulse train. (Calculate
preferably manually a few values for the coefficients so that you have "fasit" for you
programs directly in Matlab / Octave afterwards.)
b) Use Matlab / Octave and calculate numerical values for the first 6 Fourier coefficients
to the rectangular pulse train. Use a parameter, e.g. N = 6, so that the number
coefficients can easily be changed later. The coefficients are most easily calculated by first
define n = [0, N] and then multiply it by the expression of the coefficients so that you get
all the coefficients in one vector. Make sure that the DC coefficient (n = 0) is correct - depending on
whether you use the real or complex Fourier series.
c) Multiply the coefficients by the correct frequency function, sum the contributions and plot in
time domain e.g. two full periods of the analog rectangular pulse train when you bring
only the first 6 frequency components of the Fourier series. Be sure to use as many
calculation points that you get a good representation of the analog signal.
This signal is then sent through an unloaded RC low-pass filter with a buckling frequency equal to 500 Hz.
(You do not need to know component values for R and C - it is enough to know the product of them).
d) Calculate the frequency response (letter expression) of the filter by hand and use Matlab / Octave for
to plot the Bode diagram (absolute value and phase separately). Automatically generated
Bode-plot can be obtained with the commands ‘tf’ and ‘bode’ (see the PowerPoint file there
Matlab / Octave was presented). Also try plotting the Bode chart in the "usual way" -
so you can choose sensible values along the axes. If you have problems with Bodeplottet, move on now, because it is not necessary to solve the rest of the task.
Try to explain (arguments in words) what happens to the signal as it passes through the filter
and try to outline how you expect the total filtered time signal to look based on
your explanations / argument. (This last item does not need to be submitted.)
e) Calculate (with Matlab / Octave) amplitude and phase on for the first 6 frequency components for the filtered signal, ie at the output of the filter. It is done by first
to calculate the amplitude and phase given by the Bode diagram for the relevant ones
the frequency components (and put them in a vector), and then multiply by the Fourier coefficients for the respective frequency component. (Feel free to check against someone
hand calculations so that you "see that it gets right".)
f) Then multiply by the correct time function (right frequency) and sum the contributions at the output
(after the filter) and plot in the time domain e.g. two whole periods of the analog rectangular
the pulse train when you include only the first 6 frequency components in the Fourier series.
Also plot in the same diagram the signal before the filter (the one you plotted in the time domain earlier), so
that you can easily see how the filter affects the analog pulse train signal.
Copy from Matlab / Octave to a Word document, and take a picture (scan) of your calculations
letter expressions (if you do not want to write them in the Word file) and live as one file in pdf format.
It can be done i Octave as well, it is free. (This is a homework assignment which i could use some help with, especial
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am