## ngspice-users

 [Ngspice-users] help with RLC filter From: - 2005-12-30 05:55:27 ```This circuit is a band pass filter set for 535Khz. =A0instead of the graph= =20 I expect, i get 1 volt ac straight across. =A0 V1 int1 0 ac 1 sin C1 int1 0 .88p r1 int1 int2 1p L1 int2 0 100.0m =2Eac lin 20 535khz 540khz =2Eplot ac v(int1) =2Eend Thank you ahead of time, Daryl Mathison ```
 Re: [Ngspice-users] help with RLC filter From: Werner Hoch - 2005-12-30 07:30:22 ```Hi Daryl, On Friday 30 December 2005 06:56, dmathison@... wrote: > This circuit is a band pass filter set for 535Khz. =A0instead of the > graph I expect, i get 1 volt ac straight across. > > V1 int1 0 ac 1 sin > C1 int1 0 .88p > r1 int1 int2 1p > L1 int2 0 100.0m > > .ac lin 20 535khz 540khz > .plot ac v(int1) > .end * You measure the ac source v(int1) which is in fakt 1V * The C1 is usless as it is parallel to the voltage source (you can=20 remove it). * The R1/L1 combination is a highpass filter which has an very low=20 cut-off frequency. Maybe you should connect C1 to int2 and measure v(int2). But use a=20 larger serial resistance. Regards Werner ```
 Re: [Ngspice-users] help with RLC filter From: steven.borley - 2005-12-30 09:02:18 ```Daryl, You are not that far off actually. What you appear to have is a =20 shunt filter. If you have used a current source rather than a =20 voltage source you would have got the result expected (albeit the =20 frequency is a off by 1.5kHz). Wener's comments are correct but I think he mistook the circuit that =20 you actually have. Of course, how you intend to use the circuit is critical and it needs =20= to be simulated in the same way you intend it to be used. So I might =20 be wrong and Werner might be right. Regards, Steven On 30 Dec 2005, at 07:30, Werner Hoch wrote: > Hi Daryl, > > On Friday 30 December 2005 06:56, dmathison@... wrote: >> This circuit is a band pass filter set for 535Khz. instead of the >> graph I expect, i get 1 volt ac straight across. >> >> V1 int1 0 ac 1 sin >> C1 int1 0 .88p >> r1 int1 int2 1p >> L1 int2 0 100.0m >> >> .ac lin 20 535khz 540khz >> .plot ac v(int1) >> .end > > * You measure the ac source v(int1) which is in fakt 1V > * The C1 is usless as it is parallel to the voltage source (you can > remove it). > * The R1/L1 combination is a highpass filter which has an very low > cut-off frequency. > > Maybe you should connect C1 to int2 and measure v(int2). But use a > larger serial resistance. > > Regards > Werner > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through =20 > log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD =20 > SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick > _______________________________________________ > Ngspice-users mailing list > Ngspice-users@... > https://lists.sourceforge.net/lists/listinfo/ngspice-users ```
 Re: [Ngspice-users] help with RLC filter From: Andrew Ingraham - 2005-12-31 16:17:38 ```> This circuit is a band pass filter set for 535Khz. Actually, the circuit is not really a band pass filter, but it might be used as part of one. Your circuit is just a parallel LC tank (or resonant) circuit. But you are applying an ideal AC voltage source directly across the LC circuit, and then looking at that same voltage. Of course, the voltage you see IS the voltage you apply, unchanged. There are a few ways you could turn it into a filter. One is by taking the current through the circuit as your "output". But that configuration gives you a band-reject filter. Another is by changing V1 from an ideal voltage source to an ideal current source, and taking the voltage across the LC circuit as your output. A third is by using V1 as a voltage source but adding some resistance between it and the top of the LC circuit. Other configurations are possible, but these are the most obvious ones. Always keep in mind that SPICE's basic elements are ideal and may not have real-word behavior. SPICE's voltage sources have no internal resistance or impedance whatsoever, and no real signal source behaves like that! Use them in combination with other elements to construct models that better represent real devices. When simulating filters, I find it is handy to plot both the input and output signals simultaneously; for example: .plot ac v(in) v(out) If you had done this, you would have immediately recognized that your input and output signals were the same, which may have pointed you in the right direction. Also, when doing filters, often it is useful to start by looking at the very big picture, before refining your simulation. In this case, you might start with a wide frequency sweep: .ac lin 100 100kHz 1MEGHz or .ac lin 100 400kHz 600kHz before zeroing in on the center of the filter's bandpass. Looking only at 535-540 kHz might be so narrow that you don't see much change across that range (depending on Q). Or you may even miss the center of the passband. Regards, Andy ```