Plotting a frequency spectrum for an Impulse Response

41 views (last 30 days)
Impulse response diagram.jpg
Hi there,
I know I might be asking a completely novice question (and apologies on possibly spamming the forums) but I am extremely new with Matlab and still need a step by step guide on how to work this thing out. I've attached a picture on the type of graph that I'm trying to replicate.
I am currently working on trying to plot out the impulse response of a signal on a frequency domain graph. As such, I'm still struggling trying to plot a frequency spectrum graph as shown in the picture. I am unsure of how one would be able to adjust the frequency on the x-axis to match the one shown in the picture as well as how to match the magnitude (db) on the Y-axis. This is what I've got so far:
trial plot.png
I'm not sure if the steps I've taken are correct. Any help in terms of carrying out the code and steps would be appreciated!
Regards

Answers (1)

Star Strider
Star Strider on 13 Aug 2019
Since the impulse has a uniform spectrum equal to unity, the impulse response of a system (control system, filter, etc.) is generally the Fourier transform of the output of the system.
Note that Figure 4.3.5 is plotted as dB on a logarithmic frequency axis.
The plot you created appears to be linear in both axes. You can calculate dB as:
dB = 20*log10(abs(amplitude))
To plot the frequency axis logarithmically, use the semilogx plot function.
So your plot call to simulate Figure 4.3.5 would be something like:
figure
semilogx(frequency, 20*log10(abs(amplitude)))

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!