Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fourier transforms - Basic question 1

Status
Not open for further replies.

megok

Mechanical
Apr 24, 2006
2
I have uploaded some data into MATLAB and I am attempting to remove the funtamental frequency (1208.6Hz)
What I gather is the easiest way to remove fundamental is to apply a fourier transform to the data and then set 1208.6Hz to zero and then apply the inverse transform.
My problem is I don't know how to set the fundamental to zero.
Any help would be aprreciated
 
Replies continue below

Recommended for you

You need to know the samplin rate of your data and the data length. You might not have a picke that is "on" 1208.6 Hz exactly, so maybe you could stomp on two pickets.

Here is an example

fCriticalHz = 1208.6;

fs = 48000;
nSample = 1000;
fStep = fs / nsample;

fftOfData = fft( data, nSample );
fStart = -fs / 2;
fStop = ( fs / 2 ) - fStep;

frequencyPicketHz = fStart : fStep : fStop;

indexZap = find( frequencyPicketHz >= fCriticalHz );

indexZapThese = indexZap + [ -1 0 1 ];

indexZapThese = [ ( nSample - indexZapThese ) indexZapThese ];


fftOfData( indexZapThese ) = zeros( size( fftOfData( indexZapThese ) ) );
dataZapped = real( ifft( fftOfData ) );

% Sorry I did not have time to test or review this, but someof these ideas should help in understanding.


jsolar
 
You are trying to implement a digital band-stop filter.

That's a good detailed method described above.

Without providing an alternative with comparable level of detail, I am hesitant to criticize it at all. But I would point out that it implements a very square bandstop filter which will introduce artifacts in the output time waveform in some cases. More sophisticated bandstop filters have smoother transitions with a lot of mathematical thought put into them.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
There are certainly a wealth of on-line resources. You might look around dspguide.com starting here:

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
electricpete, I agree with you. I gave an example of the method megok wanted to use. I never know if these are learning exercises or part of a bigger project, so I hesitate on giving adice on a different approach sometimes (sometimes I just can;t help it).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor