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.

noise gate implementation

Status
Not open for further replies.

neira

Newbie level 2
Joined
Nov 29, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
Hi,

I really need help about this.How can I implement noise gate.
My input is wav file in form of byte array.Do I have to calculate fft?What I should compare with threshold,frequency or amplitude?What is output?
I need detail explanation as you can see.Please help, this is urgent.I know this is simple, but I just can't figure it out.
Thanks in advance,

neira
 

A MatLab description of a noise gate from literature:
Code:
function y=noisegt(x,holdtime,ltrhold,utrhold,release,attack,a,Fs)
%y=noisegt(x,holdtime,ltrhold,utrhold,release,attack,a,Fs);
% holdtime - time in seconds the sound level has to be below the
noise gate with hysteresis
% threshhold value before the gate is activated
% ltrhold - threshold value for activating the gate
% utrhold - threshold value for deactivating the gate > ltrhold
% release - time in seconds before the sound level reaches zero
% attack - time in seconds before the output sound level is the
% same as the input level after deactivating the gate
% a - pole placement of the envelope detecting filter <l
% Fs - sampling frequency
rel=round(release*Fs); %number of samples for fade
att=round(attack*Fs); %number of samples for fade
g=zeros(size(x)) ;
lthcnt=O;
uthcnt=O;
ht=round(holdtime*Fs) ;
h=filter( [(1-a)"2], [l.OOOO -2*a a-21 ,abs(x)) ;%envelope detection
h=h/max (h) ;
for i=l:length(h)
% Value below the lower threshold?
if (h(i)<=ltrhold) 1 ((h(i)<utrhold) & (lthcnt>O))
lthcnt=lthcnt+l;
uthcnt=O;
if lthcnt>ht
% Time below the lower threshold longer than the hold time?
if lthcnt>(rel+ht)
g(i)=O;
else
g(i)=l-(lthcnt-ht)/rel; % fades the signal to zero
end ;
g(i)=O;
g(i)=l;
elseif ((icht) 8! (lthcnt==i))
else
end ;
elseif (h(i)>=utrhold) I ((h(i)>ltrhold) & (uthcnt>O))
1 Value above the upper threshold or is the signal being faded in?
uthcnt=uthcnt+l;
if (g(i-i)<l)
% Has the gate been activated or isn't the signal faded in yet?
g(i)=max(uthcnt/att,g(i-l));
g(i)=i;
end ;
lthcnt=O ;
g(i)=g(i-l) ;
lthcnt=O;
uthcnt=O;
else
else
end ;
end ;
y=x . *g ;
y=y*max(abs(x))/max(abs(y));
 

Thanks.But, what is x?Signal samples in time domain, frequency, amplitude?
 

Thanks.But, what is x?Signal samples in time domain, frequency, amplitude?

Did you get to implement the noise gate?
Which was the dsp used?
How did you manage the parameters of the noise gate?
Thanks for yours commends and share the experience
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top