0

I was reading Practical Introduction to Frequency Domain Analysis. It shows how to observe the frequency content of a signal using this code:

Fs = 44100;
y = audioread('guitartune.wav');

NFFT = length(y);
Y = fft(y,NFFT);
F = ((0:1/NFFT:1-1/NFFT)*Fs).';

magnitudeY = abs(Y);        % Magnitude of the FFT
phaseY = unwrap(angle(Y));  % Phase of the FFT

helperFrequencyAnalysisPlot1(F,magnitudeY,phaseY,NFFT)

The function that plots is the helperFrequencyAnalysisPlot1. I need to know how the function does the plotting but the article never shows how. How is it actually done?

AlessioX
  • 3,167
  • 6
  • 24
  • 40
template boy
  • 10,230
  • 8
  • 61
  • 97

1 Answers1

2

These are Matlab built-in examples so you have to type in the Command Window

edit('helperFrequencyAnalysisPlot1.m')

A new Matlab editor tab will pop up, showing you the function (both its definition and the code).

AlessioX
  • 3,167
  • 6
  • 24
  • 40
  • @templateboy Even better, the help page you link to has links to the function at the very bottom. Examining the URL shows that the link points to `matlab:edit('helperFrequencyAnalysisPlot1.m')`, just as @Alessiox suggests. – craigim Mar 04 '16 at 20:34