⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 homofreq.m

📁 this program deals with homomorphic analysis of speech. it was homework assignment in digital speech
💻 M
字号:
function homoFreq(x,Fs,nfft)
% x is input signal
% nfft is number of fft points

Fs = 10e3;%sampling rate
% subplot(2,1,1),plot(x);
% title('Waveform'), xlabel('Time (ms)'), ylabel('Amplitude');

Y=fft(x.*hamming(length(x)),nfft); %nfft point fft
freqAxis=Fs/2*length(Y)/Fs;
f=(0:freqAxis)*Fs/length(Y);
% subplot(2,1,2);
spec = 20*log10(abs(Y(1:length(f))));
plot(f,spec);ylim([-50 35]);
title('Spectrum'), xlabel('Frequency'),ylabel('Log Magnitude');
[pks,locs] = findpeaks(spec);
for m = 5:5, 
    differ(m-4) = locs(m)-locs(m-1); 
    %finding the difference between 5th...
    %and 4th peak of the spectrum    
end
pitchFreq = mean(differ)*Fs/nfft;
fprintf('Pitch Frequency in Frequency Domain = %gHz\n', pitchFreq);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -