Hi, I am having some trouble trying to figure out how to plot an Amplitude vs Frequency plot from a .wav file. I think I managed to figure out how to plot the Amplitude vs Time plot though.
Here is my code:
[y,Fs]=audioread('HornC5.wav'); %Reads .wav file into 2 matrices for amplitude (y) and sampling frequency (Fs)
% sound(y,Fs); % see what it sounds like
y=y(:,1); % Converts to a single channel
dt=1/Fs;t=0:dt:(length(y)*dt)-dt; %Matrix for time points
% I don't really now how to code the Fourier Transform part :(
figure(1) subplot(2,1,1)plot(t,y); title('Horn C5'); xlabel('Time (s)'); ylabel('Amplitude'); % Amplitude vs Time plot
subplot(2,1,2)plot
Best Answer