Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Filtering signal with rapid changes with FFT
Date: Tue, 4 Aug 2009 10:36:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 64
Message-ID: <h592uh$pc0$1@fred.mathworks.com>
References: <h58mu4$2o2$1@fred.mathworks.com> <h58vuv$aee$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1249382161 25984 172.30.248.38 (4 Aug 2009 10:36:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 4 Aug 2009 10:36:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1406655
Xref: news.mathworks.com comp.soft-sys.matlab:560675


"Dave Robinson" <dave.robinson@somewhere.biz> wrote in message <h58vuv$aee$1@fred.mathworks.com>...
> "juho salminen" <jssalmi3@cc.hut.fi> wrote in message <h58mu4$2o2$1@fred.mathworks.com>...
> > Hi guys,
> > 
> > I'm newbie with signal processing who is trying to implement fft to signal filtering. My problem is following: 
> > My signal is sinusoidial Wave with noise added in it. Wave is decreasing as time passes by.
> > 
> > My current filtering technique is following: I make FFT of signal, take highest peak from FFT, and cut every sample in frequency domain into 0 except highest peak. 
> > Then I just make ifft of signal. 
> > 
> > This technique suits well for stationary sine wave, but when sine's amplitude changes rapidly with time, it seems that when signal is reversed back to time domain, some distortion to amplitudes of reversed signal is introduced. In my application, I need to get amplitudes of signals very accurately!
> > 
> > Basicly, what I'm trying is to make filter, which would not make any phase delay for signal, and would fit for signals with different frequencies...
> > 
> > Is there any other ways to do this kind of filter? 
> > 
> > Could you guys also make some example code also? My signal processing knowledge is basicly 0
> > 
> > Thanks,
> > 
> > -Juho
> 
> Your basic problem appears to be that the moment you apply amplitude modulation, your signal ceases to be a pure sine wave. 
> 
> You are in effect taking your time domain sine wave and multiplying by your amplitude modification distribution. In the frequency domain this is equivelent to convolving the Fourier transform of your sine wave (your spike) with the fourier transform of your modulation distribution - which results in a spectrum that is no longer a spike, but has been somewhat smeared. Thus now you kill every frequency component except for the spike, you are throwing away all of the information regarding your modulation distribution and hence you get what you describe as distortion.
> 
> The filter you need is not this very narrow spike that you are currently using, but one that corresponds/approximates to the Fourier transform of your amplitude modulated sine wave.
> 
> Without knowing anything about the Modulation distribution, this is about as far as I can help.
> 
> Regards
> 
> Dave Robinson  



Thank you for your response!


well, my signal could look like this (copy and paste to matlab): 

%------------------------------------------------------------------------------------

     signalLength = 15000; 
     signalFrequency=100; 
     samplingFrequency=500;
     T = 1/samplingFrequency;      % Sample time
     t = (0:signalLength-1)*T;     % Time vector
     beginningPhase = pi;
    e = 2.7182818

  dataVector = e.^(-2*pi*signalFrequency*t*0.001).*(100*sin(2*pi*signalFrequency*t)); 

originalNoise = 35*randn(1,length(t)); 
noisyDataVector = dataVector + originalNoise; 
                
%-------------------------------------------------------------------------------------------------
    

I was trying to save some values near signal spike in frequency domain (more information for ifft) , but that makes distortions for amplitude due to noise...

Is there a way to still better results ? 

Is there ANY way to filter this signal perrfectly or near perfectly? (for example, amplitude distortions always less than 1%)