MATLAB FFT: Zero Out DC Component for Better Frequency Analysis

  • Context: MATLAB 
  • Thread starter Thread starter OnceMore
  • Start date Start date
  • Tags Tags
    Fft Matlab
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
OnceMore
Messages
23
Reaction score
1
Hello,

I am hoping someone can give me some advice. I need to zero out the DC component of an FFT I have done, so I can get a better look at the rest of the frequency components, so how would one go about doing that?

I am not looking the code, just some advice ...I have just really started learning MATLAB for work, so any help would be great.

Thanks in advance.
Seán
 
Physics news on Phys.org
I suppose this depends on what exactly your "DC component" is.

The obvious answer, surely, is, after you have the FFT output in an array, is to identify which element of the array contains the DC component and set it equal to zero. If the "DC component" is actually spread over a small number of elements, set all of them zero.

If your problem is simply that the vertical scale of the graph is wrong for you to see the details you want, you have two other options:
  1. Interactively use the "magnifier glass" tool in the plot window to zoom into the area of interest
  2. Programmatically learn how to use the axis command
If your "DC component" actually spreads out over a very large number of elements, you have a bigger problem...
 
Hi, thanks for the reply!

I think zeroing the bin that has the frequency of the DC component is the best way to work it, I will try that.

Can't believe I didn't think of that haha.

I have used the 'axis' command for a few scaling problems, but I think setting the elements to zero will do that trick.

Thanks.
Seán