The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 24th, 2024, 7:02pm
Pages: 1
Send Topic Print
band pass filter in verilog ams (Read 1290 times)
ranjang
Junior Member
**
Offline



Posts: 13
india
band pass filter in verilog ams
Jan 21st, 2015, 11:28am
 
Hi,
I want to model a simple band pass filter and can any one suggest how to proceed,

Thanks,
Back to top
 
 

,
GAURAV
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: band pass filter in verilog ams
Reply #1 - Jan 22nd, 2015, 7:50am
 
I'd start with the RLC circuit model on this site:
http://www.designers-guide.org/VerilogAMS/

and then think about how to adapt that to a filter.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
ranjang
Junior Member
**
Offline



Posts: 13
india
Re: band pass filter in verilog ams
Reply #2 - Feb 3rd, 2015, 2:59am
 
Hi Geoffery,

I wanted to use the verilog ams laplace_nd and my code looks like below.

`include "disciplines.vams"
`include "constants.vams"
module bpass_fltr_tf(vin,vout);
inout vin;
output vout;
electrical vin;
electrical vout;
real Q;
parameter c_freq=31622.8 from [0:inf);
parameter F1=1K;
parameter F2=1000K;
//Bandwidth 999000Hz
//c_freq=sqrt(Fh,Fl);
//Q=F0/(FH-FL);
//BW=FH-FL;
//**************Band Pass Filter TF*********************
//((w0/Q)s)/(s^2+(w0/Q)s+w0^2)
initial
Q =c_freq/(F2-F1);

analog
V(vout)<+ laplace_nd(V(vin), {0,((`M_TWO_PI*c_freq)/Q)},{((`M_TWO_PI*c_freq)**2),((`M_TWO_PI*c_freq)/Q),1});
endmodule

and I am expecting the pass band as 1KHz to 1000KHz.

But when I give an input sine wave with very high frequency or low frequency (which is not in this pass band).Still the o/p of the filter is sine with same magnitude ie there is not much attenuation.

I wanted to know what is wrong with this also is there any wave to give varying frequency input using spectre or spice options for ultrasim.I am not sure how the testbench should look for this.
Back to top
 
 

,
GAURAV
View Profile   IP Logged
weber8722
Community Member
***
Offline



Posts: 95

Re: band pass filter in verilog ams
Reply #3 - Mar 1st, 2015, 10:59am
 
Hi,

I would prefer an RLC filter over laplace functions, because if you want to extend the filter to be e.g. controlled by a voltage, or digitally you run into problems with laplace. Laplalce functions allow only constant coefficients. Also RLC networks are more realistic, so you may use it also for tolerance investigations (corners, MC, etc.).

Bye Stephan
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.