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.

convert audio into time domain samples in matlab

Status
Not open for further replies.

achaleus

Member level 5
Joined
Dec 21, 2012
Messages
85
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Location
Bangalore
Activity points
1,866
hi all, I want to see what are the frequency components present in my audio, I will use FFT operator to convert time domain to frequency domain and I will plot to see frequencies.
please suggest how to sample the audio(say no' of samples are 1024 so that I can use 1024 point fft) in matlab
 

What kind of source of the audio signal have You got? Is it a .wav or different file? Or is it a stream from your mic/line in?
What do You mean "how to sample the audio"?
When You want to calculate the FFT You have to use the moving window, that cut the part of the signal You want to analise.
Right now is hard to tell You more information, becouse You should write more about Your problem.
 

hi cherryman thanks for the reply, I implemented 1024 point FFT on FPGA. Now I want to test by taking some real time signal, so I recorded one signal.. we can convert into .wav(by some tool), I need sets of 1024 time domain sampling points from that recorded signal,
so Please help me how to do windowing and how to convert from audio to digital data.. (sets of 1024) which is input to both matlab and FPGA, so that I can compare both outputs
 

If You have a .wav file You can just import it into Matlab. Just click right mouse button, and select import, or simply drag nad drop file to the Matlab's window. If You want to see a several sucesive FFT's over the time domain You can use the spectrogram method in matlab. You will get an image tha the one of the axis is a time domain and second is a frequency domain.
https://www.mathworks.com/help/signal/ref/spectrogram.html?searchHighlight=spectrogram
If You want to see just the FFTs You have to use some loops.

Code:
x - signal
w = boxcar(WinLength); %%hamming, hanning, kaiser etc
for i =1 : WinLength : SignalLength
xx = x(i : i + WinLength - 1).*w;
X = FFT(xx);
plot (abs(X))
pause;
end

something like that. Code shows direction for You so can have some mistakes.
If You want to use a boxcar win, You can ignore the "w" vector.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top