Hi , I make spectral analysis for female voice ( wav file for 2 word only ) , I get frequency contents below 1000 Hz , so is this correct , also I suspect computation of power of abs(fft) , please advise , thanks
2 次查看(过去 30 天)
显示 更早的评论
file1='Left_2_f.wav';
[y,fs] = audioread(file1);
L=length(y);
t=(1000*(0:1/fs:(L-1)/fs))';
n = 2^nextpow2(L);
Y=fft(y,n);
P = abs(Y/n);
P = P(1:n/2+1);
P(2:end-1) = 2*P(2:end-1);
power = abs(Y).^2/n; % power of the DFT
power = power(1:n/2+1);
power(2:end-1) = 2*power(2:end-1);
f = fs*(0:(n/2))/n;
f1 = fs*(0:n-1)/n;
figure
subplot(4,1,1)
plot(t,y)
xlabel('Time in mseconds');
ylabel('Audio Level');
title('Plot of female voice ');
grid on
grid minor
subplot(4,1,2)
plot(f,P)
title('Single-Sided Magnitude Spectrum of female voice ')
xlabel('f (Hz)')
ylabel('Magnitude')
grid on
grid minor
subplot(4,1,3)
[pk,j] = findpeaks(P,'SortStr','descend','NPeaks',8);
Peaks(:,j) = f(j);
xx=(f(:,j));
xx=(sort(xx));
[~,loc] = max(P);
plot(f(1:10*loc),P(1:10*loc),f(j),pk,'o')
title(['The maixmum of Magnitude Spectrum occurs at ( ' ,num2str(xx) , ' ) Hz' ])
xlabel('f (Hz)')
ylabel('Magnitude')
grid on
grid minor
subplot(4,1,4)
plot(f,power)
xlabel('Frequency')
ylabel('Power')
0 个评论
采纳的回答
Image Analyst
2019-3-30
It's correct - females can have audio power below 1 kHz.
To get power, try pwelch() or bandpower().
2 个评论
Yasir Muhammad
2020-12-29
would uu tell me how to read all audio files and then ploting fft and maximum spectrum
Image Analyst
2020-12-29
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!