Reputation: 1633
I have a signal of frequency 5KHz which I want to down sample to 0.5KHz.
I ran this decimate(signal, 10)
. The signal was decimated, but so was the amplitude (by a factor of 10 also).
I thought decimation only affected the sampling rate. According to http://au.mathworks.com/help/signal/ref/decimate.html, it shouldn't be doing this. I also tried using the 'fir' command, but no luck.
Screenshot (red is the decimated signal, hard to see):
Upvotes: 1
Views: 453
Reputation: 1894
Sorry, my mistake, the edited answer is:
Since you decimated your signal to 10 times (not too small factor, right?), you missed the high peaks, and you get the result without the really high peaks in the spectrum.
If you try the examples of Matlab's documentation for decimate
with factor 10, and compare with factor 4 (as Matlab used in the examples), you can see that with small factor like 4, the original one and decimated one have the same shape, but with 10, the decimated one lost some high peaks, and changed the shape.
Upvotes: 2
Reputation: 2540
I think there's nothing wrong with your result, this is just what filtering does. The high peaks in the original signal must be high-frequency components, therefore they are smoothed out after filtering and now look much smaller.
If you plot the decimated signal on a coarser grid, and look at it next to the original signal you should be able to convince yourself if this is the case or not.
Upvotes: 1