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 14 of 16 Topic 5383 of 6247
Post > Topic >>

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

by Wox <nomail@[EMAIL PROTECTED] > Feb 4, 2008 at 10:28 AM

On Sat, 2 Feb 2008 11:27:47 -0800 (PST), jdu.ustc@[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=2.
freq2=3.
freq3=4.
dtime=0.1
ntime=1000
time=dtime*findgen(ntime)
signal=sin(2*!pi*freq1*time)+sin(2*!pi*freq2*time)+sin(2*!pi*freq3*time)

; Frequency domain
nfreq=ntime/2+1
freq=findgen(nfreq)/(dtime*ntime)
fsignal=fft(signal)

; Time domain Filter
f_low = 0
f_high = 2.5
timefilter = DIGITAL_FILTER(f_low*2*dtime, f_high*2*dtime, 50.,40)
signal=convol(signal,timefilter)

; Time domain Filter in Frequency domain
ntime2=n_elements(timefilter)
nfreq2=ntime2/2+1
freq2=findgen(nfreq2)/(dtime*ntime2)
ftimefilter=fft(timefilter,1); == ntime2*fft(timefilter)

; Frequency domain filter (instead of time domain filter)
steep=50.
freqfilter= 1./(1.+(freq/f_high)^steep)
fsignal*=freqfilter

; Plot
window,0
plot,freq,abs(fsignal[0:nfreq-1])^2,xtitle='frequency',ytitle='spectrum',title='Time
domain filtered'
window,1
plot,freq,abs((fft(signal))[0:nfreq-1])^2,xtitle='frequency',ytitle='spectrum',title='Freq
domain filtered'
window,2
plot,freq,abs(freqfilter)^2,yrange=[0,1.1],ystyle=1,xtitle='frequency',ytitle='spectrum',title='Filters'
oplot,freq2,abs((ftimefilter)[0:nfreq2-1])^2,col=128
 




 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:41:46 CDT 2008.