 | | From: | Lionel Lewis | | Subject: | Amplitude reduction in downsampling | | Date: | 17 Jan 2005 19:45:22 -0800 |
|
|
 | Hi All,
According to the downsampling formula, the signal's amplitude will be reduced by a factor of the downsampling factor, M.
Why I can't get that in Matlab?
Fs=8000; n = (1:Fs)/(Fs)
s1=sin(2*pi*(Fs/8)*n); % sine waves
s2=s1(1:2:end); % downsampled by 2
S1 = fft(s1,512); S2 = fft(s2,512);
w = (0:255)/256*(Fs/2);
plot(w,abs(S1(1:256)')); % spectrum of original waveform plot(w,abs(S2(1:256)')); % spectrum of downsampled waveform
|
|
 | | From: | Rune Allnor | | Subject: | Re: Amplitude reduction in downsampling | | Date: | 18 Jan 2005 01:07:44 -0800 |
|
|
 | Lionel Lewis wrote: > Hi All, > > According to the downsampling formula, the signal's amplitude will be > reduced by a factor of the downsampling factor, M. > > Why I can't get that in Matlab? .... > S1 = fft(s1,512); > S2 = fft(s2,512);
Because you use the same FFT length, in terms of samples, in both cases. If you think about it, an N point segment of the downsampled time series is twice as long (in terms of physical time) as an N-point segment of the original time series, and thus contains twice as much energy. This cancels the lower number of samples per unit time, and causes the spectral lines to have the same amplitude.
Rune
|
|
 | | From: | Rune Allnor | | Subject: | Re: Amplitude reduction in downsampling | | Date: | 20 Jan 2005 03:26:00 -0800 |
|
|
 | Lionel Lewis wrote: > Thank alot, > > why can't N simply be number of sample in the time domain. is it > because of the computational cost?
If you ask about the FFT - yes. In the most efficient (disregarding certain practical aspects) FFT implementations N is a power of two.
If you ask about the downsampling, I don't see any reason why N should be 2 or a power of 2, you could just as well throw away 999 out of 1000 samples. Provided the signal otherwise meets all the criteria for decimation.
The thing with downsampling is that you need to start in physical time domain and compute the Fourier transform of a series representing the physical time window T. At different sampling rates, that would men different numbers of samples.
> Is there a reason why N is always power of 2
It's an easy number to work with. It's the lowest number where dwnsampling works, and that alone would make it a very popular number among textbook authors...
Rune
|
|
 | | From: | Lionel Lewis | | Subject: | Re: Amplitude reduction in downsampling | | Date: | 19 Jan 2005 08:06:16 -0800 |
|
|
 | Thank alot,
why can't N simply be number of sample in the time domain. is it because of the computational cost? Is there a reason why N is always power of 2
|
|
 | | From: | Jerry Avins | | Subject: | Re: Amplitude reduction in downsampling | | Date: | Wed, 19 Jan 2005 13:28:31 -0500 |
|
|
 | Lionel Lewis wrote:
> Thank alot, > > why can't N simply be number of sample in the time domain. is it > because of the computational cost? > Is there a reason why N is always power of 2
N can be any number for a Fourier transform. The fast Fourier transform -- FFT -- is a particular way to perform a Fourier transform with great computational efficiency, and it is most efficient when N is a power of two. Variants have been written that have good efficiency when N is the product of small integers. Programmers are a clever fellowship.
Jerry -- Engineering is the art of making what you want from things you can get. ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
|
|