SV: SV: [scilab-Users] lowpassfilter

诚 甄 dmontezano at hotmail.com
Thu Apr 15 17:11:45 CEST 2010


Hello Anders,

Your filter is correctly designed and the magnitude response is also correct.
Check your graphic and you will see that the peak value of your waveform is 0.707 (i.e. sqrt(0.5)) which is the correct
value for the 1st order Butterworth filter you designed.


Rgds,

Dan

________________________________________________
Hi Julio
 
How do you plot the freq response?
 
Regards
Anders
 
________________________________________
Från: Julio Gonzalez-Saenz [julio.gonzalez at ymail.com]
Skickat: den 15 april 2010 11:31
Till: users at lists.scilab.org
Ämne: Re: SV: [scilab-Users] lowpassfilter
 
Hi Anders,
 
I you plot the freq response of iir you see that the max value is around 0.75 same as your graphic shows.. I will take a closer look at the iir response..
 
Regards,
 
Julio Gonzalez-Saenz
www.part-time-scientists.com
www.neex-technologies.com
 
________________________________
From: Anders Sneckenborg <anders at simbalsyd.se>
To: "users at lists.scilab.org" <users at lists.scilab.org>
Sent: Thu, 15 April, 2010 7:14:38
Subject: SV: [scilab-Users] lowpassfilter
 
Hi again
 
I edited the code (removed dead code) and here it is again. It will execute exactly as before but without the disturbing dead code.
 
//---------------------------
f1 = 0.1;      //Hz
tSamp = 0.01;  //s
tMax = 200;
 
t = 0:tSamp:tMax;
y = sin(2*%pi*f1*t);
 
Order = 1;
Fcutoff = 0.1;
Fs = 1/tSamp;
hz = iir(Order,'lp','butt',[Fcutoff/Fs 0],[0 0]);
sl = tf2ss(hz);
yf = flts(y,sl);
 
plot(t,y,'-b');
plot(t,yf,'-r');
//---------------------------
 
/Anders
 
 
Från: Julio Gonzalez-Saenz [mailto:julio.gonzalez at ymail.com]
Skickat: den 14 april 2010 22:42
Till: users at lists.scilab.org
Ämne: Re: [scilab-Users] lowpassfilter
 
Hi Anders,
 
Can you please double check the semicolon on the function y definition? You also have a f1 and f2 but only f1 is defined..
 
Regards,
 
 
Julio Gonzalez-Saenz
www.part-time-scientists.com
www.neex-technologies.com
 
 
________________________________
From: Anders Sneckenborg <anders at simbalsyd.se>
To: "users at lists.scilab.org" <users at lists.scilab.org>
Sent: Wed, 14 April, 2010 22:19:29
Subject: [scilab-Users] lowpassfilter
Hi
 
When running the following script I expected the filtered signal to have an amplitude of 0.5.
My intention was to lowpassfilter a signal with the same frequency as the cutoff frequency.  Am I doing something wrong?
 
//---------------------------
f1 = 0.1;      //Hz
tSamp = 0.01;  //s
tMax = 200;
 
t = 0:tSamp:tMax;
y = 1*sin(2*%pi*f1*t);  + 0.5*sin(2*%pi*f2*t);
 
Order = 1;
Fcutoff = 0.1;
Fs = 1/tSamp;
hz = iir(Order,'lp','butt',[Fcutoff/Fs 0],[0 0]);
sl = tf2ss(hz);
yf = flts(y,sl);
 
plot(t,y,'-b');
plot(t,yf,'-r');
//---------------------------
 
Best regards
Anders
 
  I
  		 	   		  
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100415/df9b192a/attachment.htm>


More information about the users mailing list