Dear experts, I'm currently looking at frequency domain analysis via the DFT (the analysis is on specific frequency "bins" only, so I'm not interested in computaitonal savings via the FFT for now). I have a requirement to process input samples in real time (without storing any of them), so I'd like to exploit the linearity property of the DFT to ease the processing requirements. So I know that if: x1[n] + x2[n] = y[n] in the time domain, then X1(k) + X2(k) = Y(k) in the frequency domain. My initial "trick" is to play the input sequence to my processor twice (I have this luxury in this particular application). On the first run, I extract the even samples x1[n] and compute the DFT to get X1(k). On the second run, I extract the odd samples x2[n] and compute the DFT to get X2(k). As a final "post-processing" step, I just sum the individual DFTs to get the final result. In principal, this seems to work fine. Things get more interesting when I start to add noise to the input samples. I have two scenarios of practical interest here. One is where the noise spectrum is flat. In this case, the even/odd subset processing still works fine and the noise "floor" in the measurement is as expected. However, in a second scenario, the input samples also include a noise distribution which has been "shaped" by a sigma-delta modulator. In this case, the noise seems to be "flattened" by the even/odd subset processing approach - although the signal "bins" are still analysed correctly. I'd welcome your input on what this "flattening" mechanism might be - since I'd like to understand it (and ideally analyse it mathematically). Many thanks, Chris.
Exploiting linearity of the DFT
Started by ●October 11, 2010
Reply by ●October 12, 20102010-10-12
On Oct 11, 9:00=A0pm, "chriscoates" <Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote:> Dear experts, > > I'm currently looking at frequency domain analysis via the DFT (the > analysis is on specific frequency "bins" only, so I'm not interested in > computaitonal savings via the FFT for now). > > I have a requirement to process input samples in real time (without stori=ng> any of them), so I'd like to exploit the linearity property of the DFT to > ease the processing requirements. =A0 > > So I know that if: > > x1[n] + x2[n] =3D y[n] in the time domain, then > > X1(k) + X2(k) =3D Y(k) in the frequency domain. > > My initial "trick" is to play the input sequence to my processor twice (I > have this luxury in this particular application). =A0On the first run, I > extract the even samples x1[n] and compute the DFT to get X1(k). =A0On th=e> second run, I extract the odd samples x2[n] and compute the DFT to get > X2(k). =A0As a final "post-processing" step, I just sum the individual DF=Ts> to get the final result.How do you 'extract' the even and odd samples? Pull them straight out of the original sequence? Or do you interleave with zeros? What you attempt to do is only linear if you do things like (view with fixed- width font) x[n] =3D { x0 x1 x2 x3 x4 x5 ... } xo[n] =3D { 0 x1 0 x3 0 x5 ... } xe[n] =3D { x0 0 x2 0 x4 0 ... } If you pull the samples straight out of the sequence, xo'[n] =3D { x1 x3 x5 ... } xe'[n] =3D { x0 x2 x4 ... } what you do is no longer linear. Rune
Reply by ●October 12, 20102010-10-12
Thanks for your reply:>How do you 'extract' the even and odd samples? Pull them straight >out of the original sequence? Or do you interleave with zeros? >What you attempt to do is only linear if you do things like (view >with fixed- width font) > >x[n] =3D { x0 x1 x2 x3 x4 x5 ... } >xo[n] =3D { 0 x1 0 x3 0 x5 ... } >xe[n] =3D { x0 0 x2 0 x4 0 ... }This is exactly what I'm doing, as you say, to preserve the linearity of the operations. Perhaps I should clarify a little further. I am running the "full" input sequence twice. On the first run, I extract the odd samples and zero pad to form xo[n]. On the second run, I extract the even samples and zero pad to form xe[n]. The "full" sequence is nominally identical on both runs, except for the noise on the samples - I feel this point may be important. The only thing that varies between runs is the noise. In one experiment, this noise is "white" and my partial processing and recombination technique works fine. In another experiment this noise is "shaped" (i.e. slightly higher at higher frequencies, lower at lower frequencies). Using the partial processing and recombination technique, the signal content looks correct, but the "noise" gets flattened. This artefact is acceptable in my application, but I need to offer some analytical justification for it. Is is possible that: 1) I'm somehow introducing aliasing into the measurement by analysing the zero padded sequences and recombining? Or..... 2) Is there some sort of decorrelation of the shaped noise implicit in the calculation when I distribute it over two input sample runs? Any advice would be most welcome! Cheers, Chris.>On Oct 11, 9:00=A0pm, "chriscoates" ><Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote: >> Dear experts, >> >> I'm currently looking at frequency domain analysis via the DFT (the >> analysis is on specific frequency "bins" only, so I'm not interested in >> computaitonal savings via the FFT for now). >> >> I have a requirement to process input samples in real time (withoutstori=>ng >> any of them), so I'd like to exploit the linearity property of the DFTto>> ease the processing requirements. =A0 >> >> So I know that if: >> >> x1[n] + x2[n] =3D y[n] in the time domain, then >> >> X1(k) + X2(k) =3D Y(k) in the frequency domain. >> >> My initial "trick" is to play the input sequence to my processor twice(I>> have this luxury in this particular application). =A0On the first run,I>> extract the even samples x1[n] and compute the DFT to get X1(k). =A0Onth=>e >> second run, I extract the odd samples x2[n] and compute the DFT to get >> X2(k). =A0As a final "post-processing" step, I just sum the individualDF=>Ts >> to get the final result. > >How do you 'extract' the even and odd samples? Pull them straight >out of the original sequence? Or do you interleave with zeros? >What you attempt to do is only linear if you do things like (view >with fixed- width font) > >x[n] =3D { x0 x1 x2 x3 x4 x5 ... } >xo[n] =3D { 0 x1 0 x3 0 x5 ... } >xe[n] =3D { x0 0 x2 0 x4 0 ... } > >If you pull the samples straight out of the sequence, > >xo'[n] =3D { x1 x3 x5 ... } >xe'[n] =3D { x0 x2 x4 ... } > >what you do is no longer linear. > >Rune >
Reply by ●October 12, 20102010-10-12
On Oct 12, 4:23=A0am, "chriscoates" <Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote:> Thanks for your reply: > > >How do you 'extract' the even and odd samples? Pull them straight > >out of the original sequence? Or do you interleave with zeros? > >What you attempt to do is only linear if you do things like (view > >with fixed- width font) > > >x[n] =A0=3D3D { x0 x1 x2 x3 x4 x5 ... } > >xo[n] =3D3D { =A00 x1 =A00 x3 =A00 x5 ... } > >xe[n] =3D3D { x0 =A00 x2 =A00 x4 =A00 ... } > > This is exactly what I'm doing, as you say, to preserve the linearity of > the operations. > > Perhaps I should clarify a little further. =A0I am running the "full" inp=ut> sequence twice. =A0On the first run, I extract the odd samples and zero p=ad> to form xo[n]. =A0On the second run, I extract the even samples and zero =pad> to form xe[n]. =A0The "full" sequence is nominally identical on both runs=,> except for the noise on the samples - I feel this point may be important. > The only thing that varies between runs is the noise. =A0 > > In one experiment, this noise is "white" and my partial processing and > recombination technique works fine. =A0In another experiment this noise i=s> "shaped" (i.e. slightly higher at higher frequencies, lower at lower > frequencies). =A0Using the partial processing and recombination technique=,> the signal content looks correct, but the "noise" gets flattened. =A0This > artefact is acceptable in my application, but I need to offer some > analytical justification for it. > > Is is possible that: > > 1) I'm somehow introducing aliasing into the measurement by analysing the > zero padded sequences and recombining? > > Or..... > > 2) Is there some sort of decorrelation of the shaped noise implicit in th=e> calculation when I distribute it over two input sample runs? > > Any advice would be most welcome! > > Cheers, > Chris. > > > > > > >On Oct 11, 9:00=3DA0pm, "chriscoates" > ><Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote: > >> Dear experts, > > >> I'm currently looking at frequency domain analysis via the DFT (the > >> analysis is on specific frequency "bins" only, so I'm not interested i=n> >> computaitonal savings via the FFT for now). > > >> I have a requirement to process input samples in real time (without > stori=3D > >ng > >> any of them), so I'd like to exploit the linearity property of the DFT > to > >> ease the processing requirements. =3DA0 > > >> So I know that if: > > >> x1[n] + x2[n] =3D3D y[n] in the time domain, then > > >> X1(k) + X2(k) =3D3D Y(k) in the frequency domain. > > >> My initial "trick" is to play the input sequence to my processor twice > (I > >> have this luxury in this particular application). =3DA0On the first ru=n,> I > >> extract the even samples x1[n] and compute the DFT to get X1(k). =3DA0=On> th=3D > >e > >> second run, I extract the odd samples x2[n] and compute the DFT to get > >> X2(k). =3DA0As a final "post-processing" step, I just sum the individu=al> DF=3D > >Ts > >> to get the final result. > > >How do you 'extract' the even and odd samples? Pull them straight > >out of the original sequence? Or do you interleave with zeros? > >What you attempt to do is only linear if you do things like (view > >with fixed- width font) > > >x[n] =A0=3D3D { x0 x1 x2 x3 x4 x5 ... } > >xo[n] =3D3D { =A00 x1 =A00 x3 =A00 x5 ... } > >xe[n] =3D3D { x0 =A00 x2 =A00 x4 =A00 ... } > > >If you pull the samples straight out of the sequence, > > >xo'[n] =3D3D { x1 x3 x5 ... } > >xe'[n] =3D3D { x0 x2 x4 ... } > > >what you do is no longer linear. > > >Rune- Hide quoted text - > > - Show quoted text -Chris, Look again at Rune's definition of xo(n), and xe(n). When you pad with zeros, is the first number in xo(n) a zero? The second number in xe(n) a zero? Do you have have MATLAB code for this that you could post? Dirk
Reply by ●October 12, 20102010-10-12
On Oct 11, 3:00=A0pm, "chriscoates" <Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote:> Dear experts, > > I'm currently looking at frequency domain analysis via the DFT (the > analysis is on specific frequency "bins" only, so I'm not interested in > computaitonal savings via the FFT for now). > > I have a requirement to process input samples in real time (without stori=ng> any of them), so I'd like to exploit the linearity property of the DFT to > ease the processing requirements. =A0 > > So I know that if: > > x1[n] + x2[n] =3D y[n] in the time domain, then > > X1(k) + X2(k) =3D Y(k) in the frequency domain. > > My initial "trick" is to play the input sequence to my processor twice (I > have this luxury in this particular application). =A0On the first run, I > extract the even samples x1[n] and compute the DFT to get X1(k). =A0On th=e> second run, I extract the odd samples x2[n] and compute the DFT to getHow is this considered realtime processing without intermediate storage? In particular, where does the second pass of the input come from if not from storage? Hope this helps. Greg
Reply by ●October 13, 20102010-10-13
>Chris, > >Look again at Rune's definition of xo(n), and xe(n). When you pad >with zeros, is the first number in xo(n) a zero? The second number in >xe(n) a zero? > >Do you have have MATLAB code for this that you could post? > >DirkDirk, Thanks for your input. I'm absolutely sure that my zero padding is correct, and I'm aware that if I get this wrong, then any linearity assumptions I make are invalid. I actually think that the linearity relationship I posted initially is too simplistic in the presence of noise. Initially I said: If xo[n] + xe[n] = x[n] then by the linearity of the DFT, Xo(k) + Xe(k) = X(k). But what if the samples are noisy? Then I must have something like: (xo[n] + No[n]) + (xe[n] + Ne[n]) as an input to the DFT processing..... which implies in turn that there is some summation of noise spectra in the frequency domain to get the final result. The noise spectrum looks great when the noise on the input samples is "white". However, when the noise on the input samples is "shaped", it gets flattened by the odd/even processing I've described. It's this that I'm trying to understand. Thanks again, Chris.>On Oct 12, 4:23=A0am, "chriscoates" ><Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote: >> Thanks for your reply: >> >> >How do you 'extract' the even and odd samples? Pull them straight >> >out of the original sequence? Or do you interleave with zeros? >> >What you attempt to do is only linear if you do things like (view >> >with fixed- width font) >> >> >x[n] =A0=3D3D { x0 x1 x2 x3 x4 x5 ... } >> >xo[n] =3D3D { =A00 x1 =A00 x3 =A00 x5 ... } >> >xe[n] =3D3D { x0 =A00 x2 =A00 x4 =A00 ... } >> >> This is exactly what I'm doing, as you say, to preserve the linearityof>> the operations. >> >> Perhaps I should clarify a little further. =A0I am running the "full"inp=>ut >> sequence twice. =A0On the first run, I extract the odd samples and zerop=>ad >> to form xo[n]. =A0On the second run, I extract the even samples and zero=>pad >> to form xe[n]. =A0The "full" sequence is nominally identical on bothruns=>, >> except for the noise on the samples - I feel this point may beimportant.>> The only thing that varies between runs is the noise. =A0 >> >> In one experiment, this noise is "white" and my partial processing and >> recombination technique works fine. =A0In another experiment this noisei=>s >> "shaped" (i.e. slightly higher at higher frequencies, lower at lower >> frequencies). =A0Using the partial processing and recombinationtechnique=>, >> the signal content looks correct, but the "noise" gets flattened.=A0This>> artefact is acceptable in my application, but I need to offer some >> analytical justification for it. >> >> Is is possible that: >> >> 1) I'm somehow introducing aliasing into the measurement by analysingthe>> zero padded sequences and recombining? >> >> Or..... >> >> 2) Is there some sort of decorrelation of the shaped noise implicit inth=>e >> calculation when I distribute it over two input sample runs? >> >> Any advice would be most welcome! >> >> Cheers, >> Chris. >> >> >> >> >> >> >On Oct 11, 9:00=3DA0pm, "chriscoates" >> ><Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote: >> >> Dear experts, >> >> >> I'm currently looking at frequency domain analysis via the DFT (the >> >> analysis is on specific frequency "bins" only, so I'm not interestedi=>n >> >> computaitonal savings via the FFT for now). >> >> >> I have a requirement to process input samples in real time (without >> stori=3D >> >ng >> >> any of them), so I'd like to exploit the linearity property of theDFT>> to >> >> ease the processing requirements. =3DA0 >> >> >> So I know that if: >> >> >> x1[n] + x2[n] =3D3D y[n] in the time domain, then >> >> >> X1(k) + X2(k) =3D3D Y(k) in the frequency domain. >> >> >> My initial "trick" is to play the input sequence to my processortwice>> (I >> >> have this luxury in this particular application). =3DA0On the firstru=>n, >> I >> >> extract the even samples x1[n] and compute the DFT to get X1(k).=3DA0=>On >> th=3D >> >e >> >> second run, I extract the odd samples x2[n] and compute the DFT toget>> >> X2(k). =3DA0As a final "post-processing" step, I just sum theindividu=>al >> DF=3D >> >Ts >> >> to get the final result. >> >> >How do you 'extract' the even and odd samples? Pull them straight >> >out of the original sequence? Or do you interleave with zeros? >> >What you attempt to do is only linear if you do things like (view >> >with fixed- width font) >> >> >x[n] =A0=3D3D { x0 x1 x2 x3 x4 x5 ... } >> >xo[n] =3D3D { =A00 x1 =A00 x3 =A00 x5 ... } >> >xe[n] =3D3D { x0 =A00 x2 =A00 x4 =A00 ... } >> >> >If you pull the samples straight out of the sequence, >> >> >xo'[n] =3D3D { x1 x3 x5 ... } >> >xe'[n] =3D3D { x0 x2 x4 ... } >> >> >what you do is no longer linear. >> >> >Rune- Hide quoted text - >> >> - Show quoted text - > >Chris, > >Look again at Rune's definition of xo(n), and xe(n). When you pad >with zeros, is the first number in xo(n) a zero? The second number in >xe(n) a zero? > >Do you have have MATLAB code for this that you could post? > >Dirk >
Reply by ●October 13, 20102010-10-13
>How is this considered realtime processing without >intermediate storage? >In particular, where does the second pass of the input come from if >not from storage? > >Hope this helps. > >GregGreg, Thanks for your input. You're right to point out that the samples must be stored somewhere in order to run multiple passes. In this particular application, the sample source and DFT processing are separate, and I'm only concerned with the latter. There is no requirement to store the samples in the DFT processor - just an accumulator for the DFT summations. Thanks, Chris.>On Oct 11, 3:00=A0pm, "chriscoates" ><Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote: >> Dear experts, >> >> I'm currently looking at frequency domain analysis via the DFT (the >> analysis is on specific frequency "bins" only, so I'm not interested in >> computaitonal savings via the FFT for now). >> >> I have a requirement to process input samples in real time (withoutstori=>ng >> any of them), so I'd like to exploit the linearity property of the DFTto>> ease the processing requirements. =A0 >> >> So I know that if: >> >> x1[n] + x2[n] =3D y[n] in the time domain, then >> >> X1(k) + X2(k) =3D Y(k) in the frequency domain. >> >> My initial "trick" is to play the input sequence to my processor twice(I>> have this luxury in this particular application). =A0On the first run,I>> extract the even samples x1[n] and compute the DFT to get X1(k). =A0Onth=>e >> second run, I extract the odd samples x2[n] and compute the DFT to get > >How is this considered realtime processing without >intermediate storage? >In particular, where does the second pass of the input come from if >not from storage? > >Hope this helps. > >Greg > >
Reply by ●October 13, 20102010-10-13
On 10/13/2010 1:29 AM, chriscoates wrote:> > Dirk, > > Thanks for your input. > > I'm absolutely sure that my zero padding is correct, and I'm aware that if > I get this wrong, then any linearity assumptions I make are invalid. > > I actually think that the linearity relationship I posted initially is too > simplistic in the presence of noise. Initially I said: > > If xo[n] + xe[n] = x[n] then by the linearity of the DFT, Xo(k) + Xe(k) = > X(k). > > But what if the samples are noisy? Then I must have something like: > (xo[n] + No[n]) + (xe[n] + Ne[n]) as an input to the DFT processing..... > which implies in turn that there is some summation of noise spectra in the > frequency domain to get the final result. > > The noise spectrum looks great when the noise on the input samples is > "white". However, when the noise on the input samples is "shaped", it gets > flattened by the odd/even processing I've described. It's this that I'm > trying to understand. > > Thanks again, > Chris.Chris, Consider this: If you have N[n] and split it into Ne[n] and No[n] then the spectral properties of N[n] are preserved under reasonable circumstances / assumptions. But, if you generate Ne[n] and No[n] independently, then the transitions from one sample to the other in the resulting N[n] introduce something that is likely white noise .. although I'm not sure. Might this be the case here? Fred
Reply by ●October 13, 20102010-10-13
On Oct 13, 3:29=A0am, "chriscoates" <Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote:> > If xo[n] + xe[n] =3D x[n] then by the linearity of the DFT, Xo(k) + Xe(k)==3D> X(k). > > But what if the samples are noisy? =A0Then I must have something like: > (xo[n] + No[n]) + (xe[n] + Ne[n]) as an input to the DFT processing..... > which implies in turn that there is some summation of noise spectra in th=e> frequency domain to get the final result. >Suppose that I have 8 samples x[n] where n varies from 0 to 7. I can add noise to the samples to get noisy samples y[n] =3D x[n] + N[n], and *then* divide the y sequence into even and odd samples. Thus, the NOISY sample values y are ye[0] =3D x[0] + N[0]; yo[0] =3D 0 ye[1] =3D 0; yo[1] =3D x[1] + N[1] ye[2] =3D x[2] + N[2]; yo[2] =3D 0 ye[3] =3D 0; yo[3] =3D x[3] + N[3] ..... ......... ye[6] =3D x[6] + N[6]; yo[6] =3D 0 ye[7] =3D 0; yo[7] =3D x[7] + N[7] ****OR****** I can divide the sequence into even and odd samples, and THEN add noise to each of the 16 values thus created. Now I have ye[0] =3D x[0] + Ne[0]; yo[0] =3D 0 + No[0] ye[1] =3D 0 + Ne[1]; yo[1] =3D x[1] + No[1] ye[2] =3D x[2] + Ne[2]; yo[2] =3D 0 + No[2] ye[3] =3D 0 + Ne[3]; yo[3] =3D x[3] + No[3] ..... ......... ye[6] =3D x[6] + Ne[6]; yo[6] =3D 0 + No[6] ye[7] =3D 0 + Ne[7]; yo[7] =3D x[7] + No[7] ***Both*** procedures fit into the description (xo[n] + No[n]) + (xe[n] + Ne[n]) but behave differently with respect to the noise. In the first case, alternate values in each of the subsequences are guaranteed to be 0; in the second case they are not. --Dilip Sarwate
Reply by ●October 13, 20102010-10-13
On Oct 13, 3:01=A0pm, dvsarwate <dvsarw...@yahoo.com> wrote:> On Oct 13, 3:29=A0am, "chriscoates" > > <Chris.Coates2@n_o_s_p_a_m.gmail.com> wrote: > > > If xo[n] + xe[n] =3D x[n] then by the linearity of the DFT, Xo(k) + Xe(=k) =3D> > X(k). > > > But what if the samples are noisy? =A0Then I must have something like: > > (xo[n] + No[n]) + (xe[n] + Ne[n]) as an input to the DFT processing....=.> > which implies in turn that there is some summation of noise spectra in =the> > frequency domain to get the final result. > > Suppose that I have 8 samples x[n] where n varies > from 0 to 7. =A0I can add noise to the samples to > get noisy samples y[n] =3D x[n] + N[n], and *then* > divide the y sequence into even and odd samples. > Thus, the NOISY sample values y are > > ye[0] =3D x[0] + N[0]; =A0 =A0 =A0 =A0 yo[0] =3D 0 > ye[1] =3D 0; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0yo[1] =3D x[1=] + N[1]> ye[2] =3D x[2] + N[2]; =A0 =A0 =A0 =A0 yo[2] =3D 0 > ye[3] =3D 0; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0yo[3] =3D x[3=] + N[3]> ..... =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=.........> ye[6] =3D x[6] + N[6]; =A0 =A0 =A0 =A0 yo[6] =3D 0 > ye[7] =3D 0; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0yo[7] =3D x[7=] + N[7]> > ****OR****** > > I can divide the sequence into even and odd samples, > and THEN add noise to each of the 16 values thus > created. =A0Now I have > > ye[0] =3D x[0] + Ne[0]; =A0 =A0 =A0 yo[0] =3D 0 + No[0] > ye[1] =3D 0 + Ne[1]; =A0 =A0 =A0 =A0 =A0 yo[1] =3D x[1] + No[1] > ye[2] =3D x[2] + Ne[2]; =A0 =A0 =A0 yo[2] =3D 0 + No[2] > ye[3] =3D 0 + Ne[3]; =A0 =A0 =A0 =A0 =A0 yo[3] =3D x[3] + No[3] > ..... =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=.........> ye[6] =3D x[6] + Ne[6]; =A0 =A0 =A0 =A0yo[6] =3D 0 + No[6] > ye[7] =3D 0 + Ne[7]; =A0 =A0 =A0 =A0 =A0 yo[7] =3D x[7] + No[7] > > ***Both*** procedures fit into the description > > (xo[n] + No[n]) + (xe[n] + Ne[n]) > > but behave differently with respect to the noise. > In the first case, alternate values in each of the > subsequences are guaranteed to be 0; in the > second case they are not. > > --Dilip SarwateChris, As Dilip is suggesting as a possibility above, when you add noise, are you adding it to the zeros? (So you would be using twice as many noise samples as combined data samples, or using noise samples more than once. Either?) OR Are you adding the first half of your noise vector to the non-zero even points, and the second half to the nonzero odd points? OR Please tell us how the noise is being added. Dirk






