How to plot a complex power spectrum using MATLAB?

14 views (last 30 days)
I have all the |C_n|^2 and need to plot bars which represent the energy at intervals of w (angular frequency).
I guess this would be a bar graph but I want lines instead (which I can label if possible).
Something like this but only need labels for the x axis:

Accepted Answer

Clay Swackhamer
Clay Swackhamer on 11 Apr 2019
This might have what you are looking for
You could transform the data from output space (voltage vs time or similar) into a frequency spectrum (power vs frequency or similar) and then plot that.
dpb on 11 Apr 2019
Look at the example of computing PSD at
doc fft
It shows how to compute the frequency against which to plot the PSD and plots it with plot which is the normal thing.
You would simply call one of the other routines in place of plot to try something different. I've never done a PSD by either, so no idea how well it will actually work to display the information in a useful format, but you can give it a go... :)

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!