Creating a noise filter from an .m file

3 visualizzazioni (ultimi 30 giorni)
jambo mclean
jambo mclean il 22 Apr 2011
Hi Everyone,
Im a complete newbie at matlab and for a university assignment we have been given an .m file to filter out noise so we can understand a word hidden underneath distortion. The .m file given is incomplete i think and we have to complete the rest. I have added the wavread and wavplay to the .m file but i am stuck now as the file still has the distortion,
Here is the .m file output
function [t, filtered_data] = hitchhikerfilter(t, data)
%Function hitchhikerfilter
%
%A function to help filter out unwanted noise from a signal
%
%Usage: inputs: t (time vector generated from Fs = 11,025Hz
% for a 5 second signal)
% use: t = ((0 : (1 / fs) : 5 - (1 / fs))';
% data (HitchhikerPlusNoise.wav)
% outputs: t
% filtered_data (the original wav file after filtering)
%
data = wavread('hitchhikerPlusNoise.wav');
f = [0 0.1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0];
m = [1 1 0 0 0 0 0 0 0 0 0 0];
[b, a] = yulewalk(11, f, m);
filtered_data = filter(b, a, data);
filtered_data = filtered_data * 5;
wavplay(filtered_data);
%End of hitchhikerfilter.m
Any help would be really appriciated;)
Kind Regards,
James
  5 Commenti
Walter Roberson
Walter Roberson il 22 Apr 2011
Not a clue. I would note, however, that you have not clearly identified your goals. You cannot expect to remove _all_ noise, so what criteria are you to use to decide if you have successfully completed the assignment?
jambo mclean
jambo mclean il 22 Apr 2011
What it is walter, is i have a wav file and i was given this .m file by my tutor to filter out distortion he has placed over a sentence in a .wav file called hitchhikerPlusNoise.wav. I ran the file through this filter but i dont think its applying properly, or maybe im not applying the time vector to this. when i play the filtered_data at the end its not filtering the distortion out so i can make out his sentence in the .wav file...
Thanks for your reply;)
James

Accedi per commentare.

Risposte (5)

Chirag Gupta
Chirag Gupta il 22 Apr 2011
I don't have much idea about filter design, but I would assume that you need to play/tweak with the filter to minimize the distortion.
  8 Commenti
Paulo Silva
Paulo Silva il 23 Apr 2011
usually I can filter noise easily with Adobe Audition but this time I couldn't, I'm no audio expert so someone might do better.
jambo mclean
jambo mclean il 23 Apr 2011
thanks for trying Paulo;)

Accedi per commentare.


Walter Roberson
Walter Roberson il 22 Apr 2011
The yulefit() documentation says,
When specifying the frequency response, avoid excessively sharp transitions from passband to stopband. You may need to experiment with the slope of the transition region to get the best filter design.
Your transition is, however, completely sharp -- two steps passed and all remaining steps stopped.
What is the point of using
f = [0 0.1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0];
instead of
f = [0 0.1 0.1 1.0];
with corresponding
m = [1 1 0 0];
?? The output isn't (I think) made any more precise by using more steps of 0's -- the precision is determined by the order you give, 11.
Perhaps this is intended as a clue.
Have you experimented by taking the fft, zeroing the inner 90% of the frequencies, and ifft'ing back? That would correspond to a perfect band-stop applied to the original sound and would give you a clue as to whether it was a problem with not cutting the frequencies quickly enough. Have you looked at the fft to see where the real energy is? Hint: You may wish to examine this article to determine which frequencies to filter.
  5 Commenti
jambo mclean
jambo mclean il 22 Apr 2011
its 00:15 in the UK now but i look forward to try some more of your ideas in the morning. Im currently studying a networking degree, but in the first year they have added this to our core subjects, this is why its a bit hard for me to understand some things. Im a cisco CCNP and this is all way over my head... I really appriciate you guys helping, and whoever can get this working i will donate some money so you can have a beer on me;) J
jambo mclean
jambo mclean il 23 Apr 2011
did you have any luck? J

Accedi per commentare.


jambo mclean
jambo mclean il 23 Apr 2011
Still hoping for an answer to this total quandery;)
  2 Commenti
Paulo Silva
Paulo Silva il 23 Apr 2011
The word part is just too corrupted with noise, I tried with matlab and Adobe Audition, unfortunately without success, the noise isn't limited to a few frequencies, it's all over the spectrum, your teacher might have done it on purpose, try other filter types, maybe you will have more luck than me.
jambo mclean
jambo mclean il 23 Apr 2011
Thanks Paulo;)

Accedi per commentare.


bym
bym il 23 Apr 2011
  1 Commento
jambo mclean
jambo mclean il 23 Apr 2011
No, i could not add my .wav to this code;( Still stuck;(

Accedi per commentare.


jambo mclean
jambo mclean il 23 Apr 2011
hoping for more ideas? anyone?
  1 Commento
Paulo Silva
Paulo Silva il 23 Apr 2011
try asking your teacher for the code he used to add noise to the audio

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by