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 do specogram in time-freq domain for a wav file?

Status
Not open for further replies.

Girly_girl

Full Member level 2
Full Member level 2
Joined
Oct 14, 2009
Messages
143
Helped
9
Reputation
18
Reaction score
8
Trophy points
1,298
Location
UK
Activity points
2,125
Hey guys

Happy new yr 2 everyone.

We have been given an assignment to recover the signal embedded in noise.
We have been given a wav file and been asked to analyse the signal in time domain, frequency domain and mixed time-freq domain.. and also have to specify a filter for it..
I really dont know how to plot the frequency and time domain of the signal!
I would be grateful if any of you could guid me.


Thanks
 

It sounds like a MATLAB assignment, I'm not in front of my PC so can't get at the one I did at the moment.

(I've forgot the terminology and syntax as well...)

The first step is to read the file into a vector:

ReadFile = wavread'YourFile.wav';

It should be easy to plot that for starters!
 

Thanks Rob,

I have already read the wav file and got the plot for the actual signal, but im after some guid on how to do a plot of log magnituede frequency spectrum.. and a mixed time-freq domain specgram.

Anything you can guid me with ?

Thanks
 


Thanks so much Rob

I have managed to look at them all, but unfortunetly none of them really explains what i am asking!

:( Is there any way of you havin access to them files? the ones u had done before?

Thanks
 

Hi.
You can use this functions of MATLAB :
wavread,wavwrite :for readingg and writing wav file
sound: for playing signal after filtering or befor
filter : for filtering of noisy signal
I opinion that design of filters is very easy with fdatool and fvtool.
If you have any other question about FIR , IIR filters I can help u. just email your question to me.
Bye
 

Hi Reza,
Thanks
I have managed to read the wav file and make a plot for it + make it sound..
But im not too sure how to creat a program to plot the spectrum ( i.e Frequency Domain) -- fft and ifft!
And also to program to plot specgram..(mixed time-frequency domain)
Thanks
 

Girly_girl said:
:( Is there any way of you havin access to them files? the ones u had done before?

I do have have them! Sadly, I'm at work now and didn't bring them, I'll try to remember tonight!

In the meantime, this algorithm for speech template recognition might be worth a look at: **broken link removed** (Amazing how much I've forgot since my project involved porting this algorithm to an FPGA...)

It uses Specgram(), just hαck at it a bit :D. The MATLAB site lists the functions and their parameters, you might not need the same ones.

Do you need to produce a ".m" file for this? It's just a script that MATLAB follows.

It is also possible to manually apply filters and plot vectors without a .m file. Gets tiresome when you want to make changes, formatting etc.
 

Hi
THanks.. That'd be great
Yea i have used the specgram before... but is this anyhow related to the freq domain analysis? :-?? I am really really Confused!
THis things is really getting at me ! :(
Thanks for the help .. ill have a look at the link now..
Thanks rob..
 

Spectrograms are generated using a Short Time Fourier Transform so it shows the magnitude of the frequency spectrum for each block of samples.

In that example it's used to generate "feature vectors" for speech analysis.

Did you manage to run the sample through fft() and plot it? That's what the question looked like it wanted.
 

Yea
I jus had a look at the link u posted above.
I dont think it'll work cuz the example in the link uses 2 wav files, whereas i have only 1 wav file and the main aim is to recover the signal embedded in noise .. :(

Thanks
 

It sounds like you need to:

- Plot the sample in time domain.
- Transform it and plot it in frequency domain.
- Identify the noise component from the frequency domain plot.
- Create a filter to remove noise components.
- Analyse and plot the recovered audio in a spectrogram.


That example does a lot more than just a plot, thought it might be of some use.
 

yeap you got it... Thats exactly wat is required..
we got to analyse the signal bye 1. doing the time domain analysis, 2. Frequency domain analysis 3, mixed time and freq domain analysis and then filter specifications..

I'll have a look at the above link again.

Thanks so much rob,
 

The links in post four should cover it, that DTW example is complicated. It was just an application of STFT and spectrograms.

I think I have some worked examples of what you want.
 

Yea sure, I'll have a look again at them links..

I would very much appreciate if you could possibly let me have a look at some of your work.


Thanks so much :)
 

Could you upload the .wav please?

I would like to have a look at it.

Hopefully the noise is band-limited!

This post contains good explanations of the techniques used.
 

hi Rob,
Thanks
I have actually managed to do the freq spec now , but dono what filter to use to get rid of the noise..
If you could kindly send me your email address so that i could email u the .wav file as well as the spectrum...
THanks
 

PM sent!

The filter will depend upon the type of noise.
 

Not sure if the noise is from something periodic, need to autocorrelate the sample to see if there is anything with periodicity in there.

It might be a more eloquent solution than chopping a big lump out. Even though it does work :D.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top