Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to Find the DFT from .wav signal?

Status
Not open for further replies.

fikrul

Junior Member level 3
Joined
Jan 16, 2010
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,459
Hello;

Does anyone know how to get DFT results(matlab) from the .wav signal that have been frame blocking?
 

I don't know what is frame blocking but to get the DFT of a sound file

x = wavread('File_name.wav');
X = fft(X, fs);

If you mean that the frame blocking is the framing of a speech signal, here you can only get the STFT (Short Time Fourier transform) which is the fft per frame. There is no DFT for the whole speech signal because it has time varying characteristics.
 

    fikrul

    Points: 2
    Helpful Answer Positive Rating
Yes, i mean framing of a speech signal.
One more thing, what is the different between fft and rfft?
Thank you so much for helping me..
 

rfft calculates fft for real data, speech signals are of course real data. As I said, Fourier transform is applied per frame were a phoneme typically of 100 ms has constant vocal tract transfer function. The entire speech signal has a meaningless fft.
 

    fikrul

    Points: 2
    Helpful Answer Positive Rating
As you mentioned before, that fft only works at certain period such as 100ms and the rest of second won't be counted.

And you also said that fft can do per frame. Let say, after i have framing a speech signal, and it's produce 10 frames where each frame are less than 100ms, how can i do the fft for each 10 frames that i already have?

Thanks for your opinions,Ahmed.
 

u mean what the code u should use?
In your case, u'll have 10 Fourier transforms, each one show you the vocal tract frequency response for a certain acoustic sound.

Speech = wavread('file.wav');
% for fs = 8000, let the frame length be 160 sample which is 20 ms

Frames = buffer(Speech, 160);

for i = 1 : 10

fft_Frames:),i) = fft(Frames:),i),8000);

end
 

Ahmed,

I've try the code that u just given and i also replace your .wav data's with my data,
but when i compile the code, there was an error show that:

??? Error using ==> buffer
Input must be a vector.

Can you explain to me why this happen?
 

Speech is already a vector ! check the arguments of buffer, make sure it is speech and not Speech(j) for example. If still not working post it here and I'll check.
 

My codes are going like this. I already make some replacement from the code you given to me and the result is no error at all. Ahmed, how to comfirm that the code was produced a correct answer?

y = wavread('user.wav');
% for fs = 8000, let the frame length be 160 sample which is 20 ms
Y = buffer(y,160);

for i = 1 : 10

fftY:),i) = fft(Y:),i),8000)

end
 

You have to print the vector y in command prompt, and see the first 160 elements, then see the first column of the buffered result Y to ensure they're the same. there is no way to check that fourier transform is correct, but fft will always work :D
 

    fikrul

    Points: 2
    Helpful Answer Positive Rating
hi Ahmed,

So far, i already done speech processing until i got 13th coefficient of mel-frequency.
Now, im loooking to do the recognition part using neural network (MLP). Do you know how to start? i mean the step involve in neural network

Hope yoou can help me..
 

Ahmed,

I've try the code that u just given and i also replace your .wav data's with my data,
but when i compile the code, there was an error show that:

??? Error using ==> buffer

hi Fikrul,

I am sorry to interrupt your discussion. I got this error:


??? Undefined function or method 'buffer' for input arguments of type 'double'.

Do you know why is this happen? Thanks a lot in advanced.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top