preforming fourier transform to a audio file

in my project requirements im asked to preform a fourier transform for a 2secs aduio file i uploaded the audio , but i cant apply the fourier transfrom i dont even know how to start . so if someone can help me her are also the rest of the requirements .

Answers (1)

Askic V
Askic V on 4 Dec 2022
Edited: Askic V on 4 Dec 2022
Here is a small example based on Matlab's documentation on fft function
clear
[y, Fs] = audioread('guitartune.wav');
soundsc(y, Fs);
T = 1/Fs; % Sampling period
L = length(y); % Length of signal
y_fft = fft(y);
plot(abs(y_fft(:,1))) % Regular fft plot
title('Raw plot of magnitude of fft coefficients')
% Show frequency on the fft plot
f = Fs*(0:(L/2))/L;
Y = fft(y);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
figure
plot(f,P1)
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')

Products

Release

R2022b

Asked:

on 4 Dec 2022

Edited:

on 4 Dec 2022

Community Treasure Hunt

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

Start Hunting!