You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
758 B
27 lines
758 B
//VerilogA for passive,chifiltergauss,veriloga
|
|
|
|
`include "constants.vams"
|
|
`include "disciplines.vams"
|
|
|
|
module chifiltergauss(Ipow,Iphase,Ilam,Opow,Ophase,Olam);
|
|
parameter real centerfreq = 1G;
|
|
parameter real sigma = 1 from (0:inf);
|
|
parameter integer resize = 0 from [0:1];
|
|
|
|
input Ipow,Iphase,Ilam;
|
|
output Opow,Ophase,Olam;
|
|
electrical Ipow,Iphase,Ilam,Opow,Ophase,Olam;
|
|
|
|
real opow,freq;
|
|
|
|
analog begin
|
|
freq=`P_C/V(Ilam);
|
|
if (resize == 1)
|
|
opow=V(Ipow)/(sigma*sqrt(2*`M_PI))*exp(-1*pow(freq-centerfreq,2)/(2*pow(sigma,2)));
|
|
else
|
|
opow=V(Ipow)*exp(-1*pow(freq-centerfreq,2)/(2*pow(sigma,2)));
|
|
V(Opow) <+ opow;
|
|
V(Ophase) <+ V(Iphase);
|
|
V(Olam) <+ V(Ilam);
|
|
end
|
|
endmodule
|
|
|