The y-axis units after applying fft

Hello, I want to perform an FFT on 'Voltage vs time' data. I have created the following function which calls an in-built matlab function 'fft':
function [data, freq] = dataFFT(raw_data,sampling_frequency)
L = length(raw_data);
NFFT = 2^nextpow2(L);
freq = Fs/2*linspace(0,1,NFFT/2+1);
data = fft(rawData,NFFT)/L;
data = 2*abs(data(1:NFFT/2+1));
I am then calling this function as follows:
[channelFFT, f] = dataFFT(raw_data,sampling_frequency);
figure;
plot(f,channelFFT)
I am not sure what the y-axis of the plot represents. Is it Volts or Volts^2/Hz or Volts/(sqrt Hz)? In case it is volts then how should I convert it to either (Volts^2)/Hz or Volts/(sqrt Hz).
Thank you so much!

 Accepted Answer

The results of the absolute value of the output of the fft function (that you have correctly calculated and scaled) are in the same units as the original data vector. If you measured your data in Volts, the y-axis of the fft output in your code will be in Volts.

2 Comments

Thanks! Any suggestions on how to convert it to either (Volts^2)/Hz or Volts/(sqrt Hz)?
My pleasure!
The ‘Volts^2/Hz’ is what you want. I would use the periodogram (link) function to calculate it as the power spectral density.

Sign in to comment.

More Answers (0)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!