How to pass a audio signal through a filter

How to pass a audio signal through a filter ? It should work based on spectral energy i.e if its between 0-4 kHz it falls on speech band and If it falls between 4 kHz-8 kHz then it comes under noise band.Now the VOS(voice operated switch) should be activated if the signal is in speech band and it should be deactivated when it is in noise band. Can some one help me on this problem.

2 comentarios

Jan
Jan el 18 de Feb. de 2013
Please explain, what you have tried so far and which problems occurred. Suggesting improvements is much easier than solving your problem completely from scratch.
Gokul
Gokul el 18 de Feb. de 2013
I am a beginner and i need some ideas to start up with.So can u please help on how to get start with it.

Iniciar sesión para comentar.

 Respuesta aceptada

Carlos
Carlos el 18 de Feb. de 2013

1 voto

The first step is to design a filter to obtain the A and B vector coefficients.Then use the Butter function, for instance to obtain your signal(type Butter in your Matlab command window and you will find many other type of filters). Once you have obtained the B and A vector coefficients you can filter your signal using the function filter.
y=filter(x,A,B) x(is your input signal) and y your filtered signal.
Once you have filtered the signal you can calculate the spectral energy before and after filtering to find out if the filter has removed a significant part of your signal.

4 comentarios

Gokul
Gokul el 18 de Feb. de 2013
Editada: Walter Roberson el 19 de Feb. de 2013
Thank you,
I have done the following, what should be the next step
[z,fs,nb]=wavread('Piano.wav');
bfil=fft(z); %fft of input signal
wn=[4000 8000]/(fs/2); %bandpass
[b,a]=butter(6,wn);
fvtool(b,a);
f=filter(b,a,z);
afil=fft(f);
subplot(2,1,1);plot(real(bfil));
title('frequency respones of input signal');
xlabel('frequency');ylabel('magnitude');
subplot(2,1,2);plot(real(afil));
title('frequency respones of filtered signal');
xlabel('frequency');ylabel('magnitude');
abhiram
abhiram el 22 de Sept. de 2013
thanx that helped me
Odrisso
Odrisso el 14 de Nov. de 2014
Hi Carlos. I have aquestion on your code. Why you choose 6 in the line: [b,a]=butter(6,wn);
Please let me know.
Sai Manas  D C
Sai Manas D C el 1 de Jul. de 2020

6 is the order of filter, it can be any real integer. Greater the order of filter it's response approaches nearer to ideal characteristics

Iniciar sesión para comentar.

Más respuestas (5)

Carlos
Carlos el 18 de Feb. de 2013

0 votos

This is fine at the moment. Now filter with from 0 to 4000Hz to make sure the results are different(I mean if you filter from 4000 to 8000Hz and the signal after filtering is the same, then filter in the 0 to 4000Hz band to make sure the signal changes in this case).

6 comentarios

Gokul
Gokul el 18 de Feb. de 2013
Thank you sir , I am getting different results,now what does that mean ? and what should be my next step ?
Carlos
Carlos el 19 de Feb. de 2013
If you get different results, it means you are able to distinguish between noise and audio.If your signal remains unchanged when filtering the signal between 0 and 4000Hz, then you are working with an audio signal, whereas if your signal disappears, you are working with the noise signal.A way to implemet this automatically is to calculate the power of the signal(you can find some ).If the power decreases, then your signal has been filtered.
Hope it helps.
Gokul
Gokul el 19 de Feb. de 2013
Thank you, I will work on power. My question is , how can i set some threshold power and compare it wrt obtained power.If it crosses threshold ,VOS should be activated or else deactivate. is this the procedure to do it??
Carlos
Carlos el 19 de Feb. de 2013
I think it is enough if you just compare the power before and after filtering. If you filter a voice signal with a 4000 to 8000 Hz bandpass filter,it is very likely that the power of the filtered signal is very close to zero.
Darsana P M
Darsana P M el 16 de Mzo. de 2017
If i want to divide the given audio signals into different frequencies ie 20-30 Hz, 30-40Hz and so on. What should i do?
Walter Roberson
Walter Roberson el 16 de Mzo. de 2017
You could construct a collection of band-pass filters that you pass the same data through.

Iniciar sesión para comentar.

dev sanghvi
dev sanghvi el 24 de Mayo de 2016

0 votos

you can check my video.
https://youtu.be/ZPNOgLwfjNc
Sanjay  Gupta
Sanjay Gupta el 2 de Mzo. de 2017

0 votos

what is the significance of "wn" in the code?

1 comentario

Walter Roberson
Walter Roberson el 2 de Mzo. de 2017
wn is the cutoff frequency, specified as a value between 0 and 1 where 1 is the Nyquist frequency. This proportion of nyquist frequency is commonly used in filter specification, because it makes the filter calculations themselves independent of frequency.

Iniciar sesión para comentar.

Zahraa Almousawi
Zahraa Almousawi el 18 de Oct. de 2017

0 votos

if i have impulse response and i convoluted it with a sound and the sound become so noisy how can i filter it after the convolution function? i really need a help!
saikiran Puranam
saikiran Puranam el 6 de Mayo de 2020

0 votos

Can you please provide me a Matlab code for "Human Voice filtering with Band-stop filter design " Using the functions of MATLAB R2020a.

Categorías

Más información sobre Audio Processing Algorithm Design en Centro de ayuda y File Exchange.

Preguntada:

el 18 de Feb. de 2013

Comentada:

el 1 de Jul. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by