Reply by Thierry July 21, 20092009-07-21
On 21 July, 16:08, Verictor <stehu...@gmail.com> wrote:
> On Jul 21, 8:32&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > On 20 July, 17:48, Verictor <stehu...@gmail.com> wrote: > > > > On Jul 20, 7:10&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote: > > > > > On 19 July, 16:09, Verictor <stehu...@gmail.com> wrote: > > > > > > On Jul 18, 7:15&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > On 18 July, 13:54, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > > On 14 July, 18:25, Verictor <stehu...@gmail.com> wrote: > > > > > > > > > On Jul 12, 5:25&#2013266080;pm, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > > > > Hi Guys, > > > > > > > > > forgive me but it has been 10 years since i took a course insignal > > > > > > > > > processing. i am doing some simulations and i need the expression of > > > > > > > > > theautocorrelation(Rx') of asignalafter downsampling using the > > > > > > > > >autocorrelation(Rx) of the unsampledsignal. > > > > > > > > > > I think it should be :Rx'(n)=(1/M).Rx(n.M). > > > > > > > > > However, when i use the matlab xcorr function &#2013266080;with M=2, the results > > > > > > > > > don't adhere to the above formula, any help please. > > > > > > > > > > Cheers. > > > > > > > > > Why doesn't Matlab match? Can you show some samples on how you tested > > > > > > > > it? Downsample-by-2 makes power spectrum density has lower magnitude > > > > > > > > and wider "shape" while FFT the power spectrum density you will get > > > > > > > > the downsampleautocorrelation. > > > > > > > > Verictor, > > > > > > > I don't have the file in front of me. but the program was just few > > > > > > > lines, mainly: > > > > > > > x=randn(1,1000); > > > > > > > y=x(1:2:1000); > > > > > > > > Rx=xcorr(x,x)/length(x); > > > > > > > Ry=xcorr(y,y)/length(y); > > > > > > > &#2013266080;it is almost everything > > > > > > > > Cheers- Hide quoted text - > > > > > > > > - Show quoted text - > > > > > > > sorry a mistake above, it is rather > > > > > > y=zeros(1,1000); > > > > > > y(1:2:1000)=x(1:2:1000);- Hide quoted text - > > > > > > > - Show quoted text - > > > > > > Well, my understanding is that this is not exactly downsample-by-2 as > > > > > y still has 1000 samples. This is the way for downsample-by-2 (your > > > > > first lines of code) > > > > > x = randn(1,1000); > > > > > y = x(1:2:1000); &#2013266080; &#2013266080; &#2013266080;% y has 500 samples now. > > > > > > You can also use a sine waveform to see your OP equation actually is > > > > > correct.- Hide quoted text - > > > > > > - Show quoted text - > > > > > You are right Verictor &#2013266080;y = x(1:2:1000); &#2013266080;the OP equation is correct > > > > for a sinsignalas it is &#2013266080;one frequency, but it might not remain so > > > > for a wide bandwidthsignal. I should consider the case further ...- Hide quoted text - > > > > > - Show quoted text - > > > > The equation is correct as long as your downsampling didn't cause > > > aliasing. Note that you were using randn(), downsample-by-2 will cause > > > aliasing. I am sure you will notice this later. You can also use > > > multiple frequencies too but just no aliasing.- Hide quoted text - > > > > - Show quoted text - > > > but i can;t verify this using matlab. below is my script program. > > OutCorr is theautocorrelationof the non-downsampledfilter ouput. > > outcorr_s is that of thedownsampledsignal. the esrults of the script > > execution is: > > OutCorr(1:10)= > > [-0.0042,-0.0158,0.0445,0.2343,0.2637,-0.1311,-0.6974,-1.0781,-1.0527,-0.69&#2013266093;&#2013266093;12] > > OutCorr_S(1:4)=[-0.0085,0.1179,0.0663,-0.6025,-0.7993] > > max(OutCorr)=91.5355 > > max(OutCorr_S)=88.9495 > > any help please, i am sure i am missing something > > > % script > > function [OutCorr,OutCorr_S]=corrSamp() > > N=512; > > Scale=10; > > In=Scale*randn(N,1); > > % daubechies 4 filter > > Flt='db2'; > > [La,Ha]=wfilters(Flt); > > % sampling ratio > > Out=conv(In,La); > > Sampling=2; > > Out_S=Out(1:Sampling:length(Out)); > > OutCorr=xcorr(Out,Out)/length(Out); > > OutCorr_S=xcorr(Out_S,Out_S)/length(Out_S);- Hide quoted text - > > > - Show quoted text - > > I haven't used wavelet filter before so I can't comment on the filter > you used. I don't have the toolbox either but you can check your > filter response to see how good it is. Here instead, I give you a > simple script to see how it works. You can then play around your > filter. > > % simple script starts > n = 512; > scale = 10; > in = scale * randn(n,1); &#2013266080; &#2013266080; &#2013266080;% since you still prefer randn() > b = fir1(128,0.2); &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; % check how the frequency response > looks like > out = filter(b,1, in); &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080;% pass input through the anti- > aliasing filter > outcorr= xcorr(in); &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; % in is a vector > outcorr_s = xcorr(in(1:2:end)); % downsample sequency auto-correlation > max(outcorr); &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080;% I got 1.7197e+004 > max(outcorr_s); &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080;% I got 8.5983e+003 > plot(outcorr); > hold on > plot(outcorr_s, 'r') &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080;% clearly you can see what happened > according to the equation.- Hide quoted text - > > - Show quoted text -
re. the autocorrelation expression above. i think we need to divide by the number of signal samples since it is an estimation
Reply by Verictor July 21, 20092009-07-21
On Jul 21, 8:32&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote:
> On 20 July, 17:48, Verictor <stehu...@gmail.com> wrote: > > > > > > > On Jul 20, 7:10&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote: > > > > On 19 July, 16:09, Verictor <stehu...@gmail.com> wrote: > > > > > On Jul 18, 7:15&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > On 18 July, 13:54, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > On 14 July, 18:25, Verictor <stehu...@gmail.com> wrote: > > > > > > > > On Jul 12, 5:25&#2013266080;pm, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > > > Hi Guys, > > > > > > > > forgive me but it has been 10 years since i took a course insignal > > > > > > > > processing. i am doing some simulations and i need the expression of > > > > > > > > theautocorrelation(Rx') of asignalafter downsampling using the > > > > > > > >autocorrelation(Rx) of the unsampledsignal. > > > > > > > > > I think it should be :Rx'(n)=(1/M).Rx(n.M). > > > > > > > > However, when i use the matlab xcorr function &#2013266080;with M=2, the results > > > > > > > > don't adhere to the above formula, any help please. > > > > > > > > > Cheers. > > > > > > > > Why doesn't Matlab match? Can you show some samples on how you tested > > > > > > > it? Downsample-by-2 makes power spectrum density has lower magnitude > > > > > > > and wider "shape" while FFT the power spectrum density you will get > > > > > > > the downsampleautocorrelation. > > > > > > > Verictor, > > > > > > I don't have the file in front of me. but the program was just few > > > > > > lines, mainly: > > > > > > x=randn(1,1000); > > > > > > y=x(1:2:1000); > > > > > > > Rx=xcorr(x,x)/length(x); > > > > > > Ry=xcorr(y,y)/length(y); > > > > > > &#2013266080;it is almost everything > > > > > > > Cheers- Hide quoted text - > > > > > > > - Show quoted text - > > > > > > sorry a mistake above, it is rather > > > > > y=zeros(1,1000); > > > > > y(1:2:1000)=x(1:2:1000);- Hide quoted text - > > > > > > - Show quoted text - > > > > > Well, my understanding is that this is not exactly downsample-by-2 as > > > > y still has 1000 samples. This is the way for downsample-by-2 (your > > > > first lines of code) > > > > x = randn(1,1000); > > > > y = x(1:2:1000); &#2013266080; &#2013266080; &#2013266080;% y has 500 samples now. > > > > > You can also use a sine waveform to see your OP equation actually is > > > > correct.- Hide quoted text - > > > > > - Show quoted text - > > > > You are right Verictor &#2013266080;y = x(1:2:1000); &#2013266080;the OP equation is correct > > > for a sinsignalas it is &#2013266080;one frequency, but it might not remain so > > > for a wide bandwidthsignal. I should consider the case further ...- Hide quoted text - > > > > - Show quoted text - > > > The equation is correct as long as your downsampling didn't cause > > aliasing. Note that you were using randn(), downsample-by-2 will cause > > aliasing. I am sure you will notice this later. You can also use > > multiple frequencies too but just no aliasing.- Hide quoted text - > > > - Show quoted text - > > but i can;t verify this using matlab. below is my script program. > OutCorr is the autocorrelation of the non-downsampled filter ouput. > outcorr_s is that of the downsampled signal. the esrults of the script > execution is: > OutCorr(1:10)= > [-0.0042,-0.0158,0.0445,0.2343,0.2637,-0.1311,-0.6974,-1.0781,-1.0527,-0.69&#2013266093;12] > OutCorr_S(1:4)=[-0.0085,0.1179,0.0663,-0.6025,-0.7993] > max(OutCorr)=91.5355 > max(OutCorr_S)=88.9495 > any help please, i am sure i am missing something > > % script > function [OutCorr,OutCorr_S]=corrSamp() > N=512; > Scale=10; > In=Scale*randn(N,1); > % daubechies 4 filter > Flt='db2'; > [La,Ha]=wfilters(Flt); > % sampling ratio > Out=conv(In,La); > Sampling=2; > Out_S=Out(1:Sampling:length(Out)); > OutCorr=xcorr(Out,Out)/length(Out); > OutCorr_S=xcorr(Out_S,Out_S)/length(Out_S);- Hide quoted text - > > - Show quoted text -
I haven't used wavelet filter before so I can't comment on the filter you used. I don't have the toolbox either but you can check your filter response to see how good it is. Here instead, I give you a simple script to see how it works. You can then play around your filter. % simple script starts n = 512; scale = 10; in = scale * randn(n,1); % since you still prefer randn() b = fir1(128,0.2); % check how the frequency response looks like out = filter(b,1, in); % pass input through the anti- aliasing filter outcorr= xcorr(in); % in is a vector outcorr_s = xcorr(in(1:2:end)); % downsample sequency auto-correlation max(outcorr); % I got 1.7197e+004 max(outcorr_s); % I got 8.5983e+003 plot(outcorr); hold on plot(outcorr_s, 'r') % clearly you can see what happened according to the equation.
Reply by Thierry July 21, 20092009-07-21
On 20 July, 17:48, Verictor <stehu...@gmail.com> wrote:
> On Jul 20, 7:10&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > On 19 July, 16:09, Verictor <stehu...@gmail.com> wrote: > > > > On Jul 18, 7:15&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote: > > > > > On 18 July, 13:54, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > On 14 July, 18:25, Verictor <stehu...@gmail.com> wrote: > > > > > > > On Jul 12, 5:25&#2013266080;pm, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > > Hi Guys, > > > > > > > forgive me but it has been 10 years since i took a course insignal > > > > > > > processing. i am doing some simulations and i need the expression of > > > > > > > theautocorrelation(Rx') of asignalafter downsampling using the > > > > > > >autocorrelation(Rx) of the unsampledsignal. > > > > > > > > I think it should be :Rx'(n)=(1/M).Rx(n.M). > > > > > > > However, when i use the matlab xcorr function &#2013266080;with M=2, the results > > > > > > > don't adhere to the above formula, any help please. > > > > > > > > Cheers. > > > > > > > Why doesn't Matlab match? Can you show some samples on how you tested > > > > > > it? Downsample-by-2 makes power spectrum density has lower magnitude > > > > > > and wider "shape" while FFT the power spectrum density you will get > > > > > > the downsampleautocorrelation. > > > > > > Verictor, > > > > > I don't have the file in front of me. but the program was just few > > > > > lines, mainly: > > > > > x=randn(1,1000); > > > > > y=x(1:2:1000); > > > > > > Rx=xcorr(x,x)/length(x); > > > > > Ry=xcorr(y,y)/length(y); > > > > > &#2013266080;it is almost everything > > > > > > Cheers- Hide quoted text - > > > > > > - Show quoted text - > > > > > sorry a mistake above, it is rather > > > > y=zeros(1,1000); > > > > y(1:2:1000)=x(1:2:1000);- Hide quoted text - > > > > > - Show quoted text - > > > > Well, my understanding is that this is not exactly downsample-by-2 as > > > y still has 1000 samples. This is the way for downsample-by-2 (your > > > first lines of code) > > > x = randn(1,1000); > > > y = x(1:2:1000); &#2013266080; &#2013266080; &#2013266080;% y has 500 samples now. > > > > You can also use a sine waveform to see your OP equation actually is > > > correct.- Hide quoted text - > > > > - Show quoted text - > > > You are right Verictor &#2013266080;y = x(1:2:1000); &#2013266080;the OP equation is correct > > for a sinsignalas it is &#2013266080;one frequency, but it might not remain so > > for a wide bandwidthsignal. I should consider the case further ...- Hide quoted text - > > > - Show quoted text - > > The equation is correct as long as your downsampling didn't cause > aliasing. Note that you were using randn(), downsample-by-2 will cause > aliasing. I am sure you will notice this later. You can also use > multiple frequencies too but just no aliasing.- Hide quoted text - > > - Show quoted text -
but i can;t verify this using matlab. below is my script program. OutCorr is the autocorrelation of the non-downsampled filter ouput. outcorr_s is that of the downsampled signal. the esrults of the script execution is: OutCorr(1:10)= [-0.0042,-0.0158,0.0445,0.2343,0.2637,-0.1311,-0.6974,-1.0781,-1.0527,-0.6912] OutCorr_S(1:4)=[-0.0085,0.1179,0.0663,-0.6025,-0.7993] max(OutCorr)=91.5355 max(OutCorr_S)=88.9495 any help please, i am sure i am missing something % script function [OutCorr,OutCorr_S]=corrSamp() N=512; Scale=10; In=Scale*randn(N,1); % daubechies 4 filter Flt='db2'; [La,Ha]=wfilters(Flt); % sampling ratio Out=conv(In,La); Sampling=2; Out_S=Out(1:Sampling:length(Out)); OutCorr=xcorr(Out,Out)/length(Out); OutCorr_S=xcorr(Out_S,Out_S)/length(Out_S);
Reply by Verictor July 20, 20092009-07-20
On Jul 20, 7:10&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote:
> On 19 July, 16:09, Verictor <stehu...@gmail.com> wrote: > > > > > > > On Jul 18, 7:15&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote: > > > > On 18 July, 13:54, Thierry <thierrybi...@googlemail.com> wrote: > > > > > On 14 July, 18:25, Verictor <stehu...@gmail.com> wrote: > > > > > > On Jul 12, 5:25&#2013266080;pm, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > Hi Guys, > > > > > > forgive me but it has been 10 years since i took a course in signal > > > > > > processing. i am doing some simulations and i need the expression of > > > > > > the autocorrelation (Rx') of a signal after downsampling using the > > > > > > autocorrelation (Rx) of the unsampled signal. > > > > > > > I think it should be :Rx'(n)=(1/M).Rx(n.M). > > > > > > However, when i use the matlab xcorr function &#2013266080;with M=2, the results > > > > > > don't adhere to the above formula, any help please. > > > > > > > Cheers. > > > > > > Why doesn't Matlab match? Can you show some samples on how you tested > > > > > it? Downsample-by-2 makes power spectrum density has lower magnitude > > > > > and wider "shape" while FFT the power spectrum density you will get > > > > > the downsample autocorrelation. > > > > > Verictor, > > > > I don't have the file in front of me. but the program was just few > > > > lines, mainly: > > > > x=randn(1,1000); > > > > y=x(1:2:1000); > > > > > Rx=xcorr(x,x)/length(x); > > > > Ry=xcorr(y,y)/length(y); > > > > &#2013266080;it is almost everything > > > > > Cheers- Hide quoted text - > > > > > - Show quoted text - > > > > sorry a mistake above, it is rather > > > y=zeros(1,1000); > > > y(1:2:1000)=x(1:2:1000);- Hide quoted text - > > > > - Show quoted text - > > > Well, my understanding is that this is not exactly downsample-by-2 as > > y still has 1000 samples. This is the way for downsample-by-2 (your > > first lines of code) > > x = randn(1,1000); > > y = x(1:2:1000); &#2013266080; &#2013266080; &#2013266080;% y has 500 samples now. > > > You can also use a sine waveform to see your OP equation actually is > > correct.- Hide quoted text - > > > - Show quoted text - > > You are right Verictor &#2013266080;y = x(1:2:1000); &#2013266080;the OP equation is correct > for a sin signal as it is &#2013266080;one frequency, but it might not remain so > for a wide bandwidth signal. I should consider the case further ...- Hide quoted text - > > - Show quoted text -
The equation is correct as long as your downsampling didn't cause aliasing. Note that you were using randn(), downsample-by-2 will cause aliasing. I am sure you will notice this later. You can also use multiple frequencies too but just no aliasing.
Reply by Thierry July 20, 20092009-07-20
On 19 July, 16:09, Verictor <stehu...@gmail.com> wrote:
> On Jul 18, 7:15&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > On 18 July, 13:54, Thierry <thierrybi...@googlemail.com> wrote: > > > > On 14 July, 18:25, Verictor <stehu...@gmail.com> wrote: > > > > > On Jul 12, 5:25&#2013266080;pm, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > Hi Guys, > > > > > forgive me but it has been 10 years since i took a course in signal > > > > > processing. i am doing some simulations and i need the expression of > > > > > the autocorrelation (Rx') of a signal after downsampling using the > > > > > autocorrelation (Rx) of the unsampled signal. > > > > > > I think it should be :Rx'(n)=(1/M).Rx(n.M). > > > > > However, when i use the matlab xcorr function &#2013266080;with M=2, the results > > > > > don't adhere to the above formula, any help please. > > > > > > Cheers. > > > > > Why doesn't Matlab match? Can you show some samples on how you tested > > > > it? Downsample-by-2 makes power spectrum density has lower magnitude > > > > and wider "shape" while FFT the power spectrum density you will get > > > > the downsample autocorrelation. > > > > Verictor, > > > I don't have the file in front of me. but the program was just few > > > lines, mainly: > > > x=randn(1,1000); > > > y=x(1:2:1000); > > > > Rx=xcorr(x,x)/length(x); > > > Ry=xcorr(y,y)/length(y); > > > &#2013266080;it is almost everything > > > > Cheers- Hide quoted text - > > > > - Show quoted text - > > > sorry a mistake above, it is rather > > y=zeros(1,1000); > > y(1:2:1000)=x(1:2:1000);- Hide quoted text - > > > - Show quoted text - > > Well, my understanding is that this is not exactly downsample-by-2 as > y still has 1000 samples. This is the way for downsample-by-2 (your > first lines of code) > x = randn(1,1000); > y = x(1:2:1000); &#2013266080; &#2013266080; &#2013266080;% y has 500 samples now. > > You can also use a sine waveform to see your OP equation actually is > correct.- Hide quoted text - > > - Show quoted text -
You are right Verictor y = x(1:2:1000); the OP equation is correct for a sin signal as it is one frequency, but it might not remain so for a wide bandwidth signal. I should consider the case further ...
Reply by Verictor July 19, 20092009-07-19
On Jul 18, 7:15&#2013266080;am, Thierry <thierrybi...@googlemail.com> wrote:
> On 18 July, 13:54, Thierry <thierrybi...@googlemail.com> wrote: > > > > > > > On 14 July, 18:25, Verictor <stehu...@gmail.com> wrote: > > > > On Jul 12, 5:25&#2013266080;pm, Thierry <thierrybi...@googlemail.com> wrote: > > > > > Hi Guys, > > > > forgive me but it has been 10 years since i took a course in signal > > > > processing. i am doing some simulations and i need the expression of > > > > the autocorrelation (Rx') of a signal after downsampling using the > > > > autocorrelation (Rx) of the unsampled signal. > > > > > I think it should be :Rx'(n)=(1/M).Rx(n.M). > > > > However, when i use the matlab xcorr function &#2013266080;with M=2, the results > > > > don't adhere to the above formula, any help please. > > > > > Cheers. > > > > Why doesn't Matlab match? Can you show some samples on how you tested > > > it? Downsample-by-2 makes power spectrum density has lower magnitude > > > and wider "shape" while FFT the power spectrum density you will get > > > the downsample autocorrelation. > > > Verictor, > > I don't have the file in front of me. but the program was just few > > lines, mainly: > > x=randn(1,1000); > > y=x(1:2:1000); > > > Rx=xcorr(x,x)/length(x); > > Ry=xcorr(y,y)/length(y); > > &#2013266080;it is almost everything > > > Cheers- Hide quoted text - > > > - Show quoted text - > > sorry a mistake above, it is rather > y=zeros(1,1000); > y(1:2:1000)=x(1:2:1000);- Hide quoted text - > > - Show quoted text -
Well, my understanding is that this is not exactly downsample-by-2 as y still has 1000 samples. This is the way for downsample-by-2 (your first lines of code) x = randn(1,1000); y = x(1:2:1000); % y has 500 samples now. You can also use a sine waveform to see your OP equation actually is correct.
Reply by Thierry July 18, 20092009-07-18
On 18 July, 13:54, Thierry <thierrybi...@googlemail.com> wrote:
> On 14 July, 18:25, Verictor <stehu...@gmail.com> wrote: > > > > > > > On Jul 12, 5:25&#2013266080;pm, Thierry <thierrybi...@googlemail.com> wrote: > > > > Hi Guys, > > > forgive me but it has been 10 years since i took a course in signal > > > processing. i am doing some simulations and i need the expression of > > > the autocorrelation (Rx') of a signal after downsampling using the > > > autocorrelation (Rx) of the unsampled signal. > > > > I think it should be :Rx'(n)=(1/M).Rx(n.M). > > > However, when i use the matlab xcorr function &#2013266080;with M=2, the results > > > don't adhere to the above formula, any help please. > > > > Cheers. > > > Why doesn't Matlab match? Can you show some samples on how you tested > > it? Downsample-by-2 makes power spectrum density has lower magnitude > > and wider "shape" while FFT the power spectrum density you will get > > the downsample autocorrelation. > > Verictor, > I don't have the file in front of me. but the program was just few > lines, mainly: > x=randn(1,1000); > y=x(1:2:1000); > > Rx=xcorr(x,x)/length(x); > Ry=xcorr(y,y)/length(y); > &#2013266080;it is almost everything > > Cheers- Hide quoted text - > > - Show quoted text -
sorry a mistake above, it is rather y=zeros(1,1000); y(1:2:1000)=x(1:2:1000);
Reply by Thierry July 18, 20092009-07-18
On 14 July, 18:25, Verictor <stehu...@gmail.com> wrote:
> On Jul 12, 5:25&#2013266080;pm, Thierry <thierrybi...@googlemail.com> wrote: > > > Hi Guys, > > forgive me but it has been 10 years since i took a course in signal > > processing. i am doing some simulations and i need the expression of > > the autocorrelation (Rx') of a signal after downsampling using the > > autocorrelation (Rx) of the unsampled signal. > > > I think it should be :Rx'(n)=(1/M).Rx(n.M). > > However, when i use the matlab xcorr function &#2013266080;with M=2, the results > > don't adhere to the above formula, any help please. > > > Cheers. > > Why doesn't Matlab match? Can you show some samples on how you tested > it? Downsample-by-2 makes power spectrum density has lower magnitude > and wider "shape" while FFT the power spectrum density you will get > the downsample autocorrelation.
Verictor, I don't have the file in front of me. but the program was just few lines, mainly: x=randn(1,1000); y=x(1:2:1000); Rx=xcorr(x,x)/length(x); Ry=xcorr(y,y)/length(y); it is almost everything Cheers
Reply by Verictor July 14, 20092009-07-14
On Jul 12, 5:25&#2013266080;pm, Thierry <thierrybi...@googlemail.com> wrote:
> Hi Guys, > forgive me but it has been 10 years since i took a course in signal > processing. i am doing some simulations and i need the expression of > the autocorrelation (Rx') of a signal after downsampling using the > autocorrelation (Rx) of the unsampled signal. > > I think it should be :Rx'(n)=(1/M).Rx(n.M). > However, when i use the matlab xcorr function &#2013266080;with M=2, the results > don't adhere to the above formula, any help please. > > Cheers.
Why doesn't Matlab match? Can you show some samples on how you tested it? Downsample-by-2 makes power spectrum density has lower magnitude and wider "shape" while FFT the power spectrum density you will get the downsample autocorrelation.
Reply by Rune Allnor July 13, 20092009-07-13
On 14 Jul, 02:44, Thierry <thierrybi...@googlemail.com> wrote:
> > Once you throw half or more > > samples of x[n] away, there is no reason to think you will get > > easy or convenient expressions for R'xx[k] = E[x[Mn]x[k+Mn]] > > in terms of Rxx[m] = E[x[n]x[m+n]]. > > > Rune > > Ok, thanks Rune for your answer. another question, if we sample a > signal with Gaussian distribution., will the sampled signal be > Gaussian as well? Is there any proportionality &#2013266080;between their > variances and means,,,,i presume no, using your argument above
The PDF and the autocorrelation are two different quantities. The PDF says something about the distribution of amplitude values. If you start out with a continuous-time signal with a Gaussian PDF and sample it, I see no reason why the discrete-time signal won't be Gaussian with similar means and variances as the continuous-time case. The autocorrelation, on the other hand, expresses something about the *sequence* of samples, or how the amplitudes are grouped in time. Then you have to consider the 'true' autocorrelation and PDF versus *estimated* values. Since you work with data, you have to analyze the different estimators. Som estimators are poor, some are better. Even if they have the same expected values, different estimators produce different estimates of the same quantities, based on the same data. The devil is in the details. Rune