The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Modeling >> Behavioral Models >> band pass filter in verilog ams
https://designers-guide.org/forum/YaBB.pl?num=1421868511

Message started by ranjang on Jan 21st, 2015, 11:28am

Title: band pass filter in verilog ams
Post by ranjang on Jan 21st, 2015, 11:28am

Hi,
I want to model a simple band pass filter and can any one suggest how to proceed,

Thanks,

Title: Re: band pass filter in verilog ams
Post by Geoffrey_Coram on 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.

Title: Re: band pass filter in verilog ams
Post by ranjang on 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.

Title: Re: band pass filter in verilog ams
Post by weber8722 on 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

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.