MATLAB FFT question

  • MATLAB
  • Thread starter OnceMore
  • Start date
  • #1
23
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
 

Answers and Replies

  • #2
DrGreg
Science Advisor
Gold Member
2,349
1,216
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 in to 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...
 
  • #3
23
1
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
 

Related Threads on MATLAB FFT question

  • Last Post
Replies
1
Views
5K
  • Last Post
Replies
12
Views
5K
  • Last Post
Replies
0
Views
3K
  • Last Post
Replies
10
Views
5K
  • Last Post
Replies
2
Views
4K
Replies
0
Views
4K
Replies
11
Views
2K
  • Last Post
Replies
1
Views
18K
Replies
1
Views
2K
Replies
4
Views
10K
Top