FFT Spectrum Analyzer
Compute the magnitude spectrum of a real-valued vector using FFT.
Constraints
- Input vector must be 1D.
- Use abs() on FFT output.
- Return only first half of spectrum.
- No loops allowed.
1function mag = spectrum(x)2% TODO3end
Compute the magnitude spectrum of a real-valued vector using FFT.
1function mag = spectrum(x)2% TODO3end