Finding formants in speech signal
71 views (last 30 days)
I'm trying to find first 4 formants in signal with sliding window, but I'm getting some different results .
samples = importdata('samples.txt');
signal_preemf = filter(1,[1 0.95],samples);
signal_hamm = signal_part.*hamming(length(signal_part));
signal_LPC = [lpc(signal_hamm,70) zeros(1,100)];
df = (Fs/2)*linspace(0,1,N);
I should get frequencies around:
But I have mixed F1 with F2 and getting additional formants in higher frequencies.
Is it only guessing numbers of LPC coefficients with adjusting resolutoin of FFT ?
Christopher McCausland on 4 Feb 2022
To recalculate your axis have a look at my example below;
% Compute a 1024 point fft for my signal
ecgcleanNoDCFFT = fft(ecgcleanNoDC, 1024);
% Convert axis to Hz
Fs = 200;
f = (0:511)*((Fs/2)/512);
% Plot single side of spectrum
xlabel ('Frequency(Hz)'); % labels x-axis of spectral plot
ylabel ('Magnitude of Fourier Transform'); % labels y-axis of spectral plot
Here I have a sampling frequency of 200 Hz and a 1024 bin fft. I compute 'f' to calculate my bin frequencies which depends on the number of bins I want and the sampling frequency. As I am only plotting the single sided spectum I will only use half of the bins (as the other half give the same information but - x-axis). I can then use 'plot' to plot my newly calculated x-axis values 'f' against the absoloute value of my fft.
Let me know how you get on,