Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: How to perf...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 16 of 16 Topic 5383 of 6247
Post > Topic >>

Re: How to perform the 1-D signal filter?

by jdu <jdu.ustc@[EMAIL PROTECTED] > Feb 4, 2008 at 08:48 AM

On 2=D4=C24=C8=D5, =CF=C2=CE=E75=CA=B128=B7=D6, Wox <nom...@[EMAIL PROTECTED]
>
wro=
te:
> On Sat, 2 Feb 2008 11:27:47 -0800 (PST), jdu.u...@[EMAIL PROTECTED]
 wrote:
> >I found that the the value of the peak in the second figure is lower
> >than those in first and third figure. Why does it happen?
> >And the filtered signal_1 is not equal to the real part of signal_2.
> >Does it mean that the filter in time domain is not exactly equal to it
> >in frequency domain?
>
> Well, I'm not sure. If you execute the code below, you will see that
> the two filters are similar. Maybe this is just the result of the
> intrinsic approximation of time domain filtering?
>
> ; Time domain
> freq1=3D2.
> freq2=3D3.
> freq3=3D4.
> dtime=3D0.1
> ntime=3D1000
> time=3Ddtime*findgen(ntime)
>
signal=3Dsin(2*!pi*freq1*time)+sin(2*!pi*freq2*time)+sin(2*!pi*freq3*time)=

>
> ; Frequency domain
> nfreq=3Dntime/2+1
> freq=3Dfindgen(nfreq)/(dtime*ntime)
> fsignal=3Dfft(signal)
>
> ; Time domain Filter
> f_low =3D 0
> f_high =3D 2.5
> timefilter =3D DIGITAL_FILTER(f_low*2*dtime, f_high*2*dtime, 50.,40)
> signal=3Dconvol(signal,timefilter)
>
> ; Time domain Filter in Frequency domain
> ntime2=3Dn_elements(timefilter)
> nfreq2=3Dntime2/2+1
> freq2=3Dfindgen(nfreq2)/(dtime*ntime2)
> ftimefilter=3Dfft(timefilter,1); =3D=3D ntime2*fft(timefilter)
>
> ; Frequency domain filter (instead of time domain filter)
> steep=3D50.
> freqfilter=3D 1./(1.+(freq/f_high)^steep)
> fsignal*=3Dfreqfilter
>
> ; Plot
> window,0
>
plot,freq,abs(fsignal[0:nfreq-1])^2,xtitle=3D'frequency',ytitle=3D'spectru=
m',title=3D'Time
> domain filtered'
> window,1
>
plot,freq,abs((fft(signal))[0:nfreq-1])^2,xtitle=3D'frequency',ytitle=3D's=
pectrum',title=3D'Freq
> domain filtered'
> window,2
>
plot,freq,abs(freqfilter)^2,yrange=3D[0,1.1],ystyle=3D1,xtitle=3D'frequenc=
y',ytitle=3D'spectrum',title=3D'Filters'
> oplot,freq2,abs((ftimefilter)[0:nfreq2-1])^2,col=3D128

In this example, max(abs(fsignal[0:nfreq-1])^2) =3D 0.249995 and
max(abs((fft(signal))[0:nfreq-1])^2) =3D 0.211242.
The peak of spectra in window 0 is not equal to it in window 1.
Does this difference between them result from the arithmetical errors
of the filters?
Is there any methods to eliminate it?


> ftimefilter=3Dfft(timefilter,1); =3D=3D ntime2*fft(timefilter)
Besides, I don't know why you use the inverse transform instead of
the forward transform in IDL to caculate ftimefilter.

Du
 




 16 Posts in Topic:
How to perform the 1-D signal filter?
"duxiyu@[EMAIL PROTE  2008-02-01 02:20:52 
Re: How to perform the 1-D signal filter?
Wox <nomail@[EMAIL PRO  2008-02-01 14:27:59 
Re: How to perform the 1-D signal filter?
David Fanning <news@[E  2008-02-01 07:16:26 
Re: How to perform the 1-D signal filter?
Wox <nomail@[EMAIL PRO  2008-02-01 18:16:30 
Re: How to perform the 1-D signal filter?
"duxiyu@[EMAIL PROTE  2008-02-01 06:54:42 
Re: How to perform the 1-D signal filter?
Wox <nomail@[EMAIL PRO  2008-02-01 17:57:33 
Re: How to perform the 1-D signal filter?
"Kenneth P. Bowman&q  2008-02-01 08:58:38 
Re: How to perform the 1-D signal filter?
David Fanning <news@[E  2008-02-01 11:30:29 
Re: How to perform the 1-D signal filter?
"Kenneth P. Bowman&q  2008-02-01 17:27:02 
Re: How to perform the 1-D signal filter?
David Fanning <news@[E  2008-02-01 18:07:17 
Re: How to perform the 1-D signal filter?
"duxiyu@[EMAIL PROTE  2008-02-02 07:14:05 
Re: How to perform the 1-D signal filter?
"duxiyu@[EMAIL PROTE  2008-02-02 07:20:22 
Re: How to perform the 1-D signal filter?
jdu.ustc@[EMAIL PROTECTED  2008-02-02 11:27:47 
Re: How to perform the 1-D signal filter?
Wox <nomail@[EMAIL PRO  2008-02-04 10:28:58 
Re: How to perform the 1-D signal filter?
jdu <jdu.ustc@[EMAIL P  2008-02-04 08:48:08 
Re: How to perform the 1-D signal filter?
jdu <jdu.ustc@[EMAIL P  2008-02-04 08:48:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 13:39:56 CDT 2008.