Performing Fourier transform on .wav file

1 view (last 30 days)
What I want to do is perform a fourier transform on a song in *.wav form. I am able to bring the file into my workspace using
[file, pathname] = uigetfile('*.wav')
and selecting the file I want. However, I cannot get farther than this: when I try to get information about the file through
audioinfo(file) or audio read(file)
I get the error message, "The filename specified was not found in the MATLAB path."
What does this mean, and how can I perform the fft on this particular file?
Thank you!!

Accepted Answer

Walter Roberson
Walter Roberson on 8 Feb 2016
filename = fullfile(pathname, file);
[data, Fs] = wavread(filename);
freqdata = fft(data);

More Answers (0)

Community Treasure Hunt

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

Start Hunting!