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.

question on Allpass filter

Status
Not open for further replies.

gadagkar.rohit

Junior Member level 2
Joined
Apr 7, 2010
Messages
23
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
San Jose
Activity points
1,439
Hello,

I am designing an all pass filter which is a part of a reverberation generator for audio inputs. I am implementing it in verilog.

The difference equation that i am using is

y(n) = x(n-N) - g*x(n) + g*y(n-N);
g - gain, N - filter order
the transfer function is H(z) = [-g + Z^(-N)]/[1 - g*Z^(-N)]

With g = 0.2, when I give a sine input at 5 KHz at -40db, the output is +5db. so the gain is 45db.

I am really confused with the overall result. how exactly is the value of g affecting the gain.

Please let me know if I ve gone wrong at any step or my understanding. Please help me with this.
 

when i plot the frequency response using matlab with filter coefficients b = [-0.2 0 0 0 1] and a= [1 0 0 0 -0.2] i got a flat spectrum (here N = 3, g = 0.2). or for that matter with any value of N, i got a flat spectrum.
i used freqz(b,a).

---------- Post added at 09:47 ---------- Previous post was at 09:41 ----------

initially i was given this equation to use,
y(n) = g*y(n-N) - x(n) + (1+g)*x(n-N);
but that equation didnt give a flat spectrum. does this look like one?
 

For different frequencies, you get different gains and different phases (lags). g is a filter parameter, which is not directly related to the filter overall gain on a given frequency. U can plot |H(jw,g)| for the fixed frequency of 5kHz to see how g affects the filter gain at that frequency...
 

Hello RaulPinheiro,

Thanks for the reply.

Am I doing anything wrong here - b = [-0.2 0 0 0 1] and a= [1 0 0 0 -0.2]. or is my difference equation correct?

Thanks for you help
 

y(n) = g*y(n-N) - x(n) + (1+g)*x(n-N);

y(n)- g*y(n-N) = - x(n) + (1+g)*x(n-N);

(1-z^-N)Y=(-1+(1+g)z^-N)X

H=Y/X=(-1+(1+g)z^-N) / (1-z^-N)

for N=5

b=[-1 0 0 0 0 (1+g)] (numerator)
a=[1 0 0 0 0 -1] (denominator)

note that for N=5, a and b are length 6

You must study some dsp in order to implement a filter.
Otherwise, u wont have a clue on what u're doing...

Raul



Hello RaulPinheiro,

Thanks for the reply.

Am I doing anything wrong here - b = [-0.2 0 0 0 1] and a= [1 0 0 0 -0.2]. or is my difference equation correct?

Thanks for you help


---------- Post added at 12:46 ---------- Previous post was at 12:44 ----------

CORRECTION

y(n) = g*y(n-N) - x(n) + (1+g)*x(n-N);

y(n)- g*y(n-N) = - x(n) + (1+g)*x(n-N);

(1-gz^-N)Y=(-1+(1+g)z^-N)X

H=Y/X=(-1+(1+g)z^-N) / (1-gz^-N)

for N=5

b=[-1 0 0 0 0 (1+g)] (numerator)
a=[1 0 0 0 0 -g] (denominator)

note that for N=5, a and b are length 6

You must study some dsp in order to implement a filter.
Otherwise, u wont have a clue on what u're doing...

Raul
 

Hi Raul,

Thanks for the reply. when i plotted the response of the filter that you gave. It looks like a multinotch filter.
I ve attached it. Please have a look.
 

Hi Raul,

Thanks for the reply. when i plotted the response of the filter that you gave. It looks like a multinotch filter.
I ve attached it. Please have a look.

jdghjdjdjjtdujtuteutedyu
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top