DSPRelated.com
Forums

Generating Scalar Data from Complex Data

Started by John E. Hadstate January 24, 2008
Is it possible to generate a scalar sampled data stream from a 
sampled complex data stream without losing information?

For example, can I take complex data that was sampled at 100 
Hz. with a bandwidth of +/- 50 Hz around 0 Hz. and convert it 
to a scalar data stream that is sampled (effectively) at 200 Hz 
and preserve all the information between 0 and 100 Hz?


John E. Hadstate wrote:

> Is it possible to generate a scalar sampled data stream from a sampled > complex data stream without losing information?
> For example, can I take complex data that was sampled at 100 Hz. with a > bandwidth of +/- 50 Hz around 0 Hz. and convert it to a scalar data > stream that is sampled (effectively) at 200 Hz and preserve all the > information between 0 and 100 Hz?
Sample at -200i Hz. (5i ms sample period) Not quite because that will need an interleaved data stream, but there is a sampled 200Hz data stream that preserves the information. For quantized data you might have some rounding errors such that it isn't exactly the same information. -- glen
"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message 
news:B9ydnYd77OvehATanZ2dnUVZ_g6dnZ2d@comcast.com...
> John E. Hadstate wrote: > > >> For example, can I take complex data that was sampled at 100 >> Hz. with a bandwidth of +/- 50 Hz around 0 Hz. and convert >> it to a scalar data stream that is sampled (effectively) at >> 200 Hz and preserve all the information between 0 and 100 >> Hz? > > Sample at -200i Hz. (5i ms sample period) > > Not quite because that will need an interleaved data stream, > but there is a sampled 200Hz data stream that preserves > the information.
My data stream is already interleaved (real, imag, real, imag, ...) with each (real, imag) pair representing one complex sample. How do I mechanize sampling the interleaved data at -200i Hz?
On 24 Jan, 22:27, "John E. Hadstate" <jh113...@hotmail.com> wrote:
> Is it possible to generate a scalar sampled data stream from a > sampled complex data stream without losing information?
Yes, it is possible. But as you already hint at, one needs to squeeze in twice the number of real-valued samples.
> For example, can I take complex data that was sampled at 100 > Hz. with a bandwidth of +/- 50 Hz around 0 Hz.
This is one possible source of confusion. With complex-valued data it is sufficient to use a sample frequency larger than the bandwidth (as opposed to twice the bandwidth with real- valued data), and the spectrum is no longer symmetric around f = 0. So if you sample at 100 Hz, consider the bandwidth [0, 100], not [-50, 50].
> and convert it > to a scalar data stream that is sampled (effectively) at 200 Hz > and preserve all the information between 0 and 100 Hz?
Sure. One simple way of achieving this *offline* is easily implemented in matlab as N = length(x); % x contains complex-valued data X = fft(x); yy = ifft(x,2*N); y = 2*real(yy); It is left as an excercise for the reader to implement this directly in time domain... ;) [*] Rune [*] If somebody should suspect I say that because I don't know how to implement this, they are right...
"Rune Allnor" <allnor@tele.ntnu.no> wrote in message 
news:7a5b10e6-ece6-4b6a-8ed2-97362b5113e7@u10g2000prn.googlegroups.com...

> > N = length(x); % x contains complex-valued data > X = fft(x); > yy = ifft(x,2*N); > y = 2*real(yy); > > It is left as an excercise for the reader to implement > this directly in time domain... ;) [*] >
Perhaps I should have started with, "I was given a file that was recorded at enormous expense by a committee that didn't understand the implications of its choices and thought it was being exceedingly clever by choosing to record complex samples." The problem is that none of the analysis tools available to us will process complex data directly in the way we need to process it. For various reasons, telling the committee to pound sand is not a viable option. Neither is it possible to discard the recordings and re-record the data. I suspect that the hardware that produced this recording actually sampled the data as scalar, then converted it to quadrature for recording by multiplying the scalar stream by cos(Fs/4) and sin(Fs/4), etc. Can I invert this process in the time-domain without losing information and, if so, how? In my problem domain, N > 1 Gb. so an FFT-based solution on the whole data set is not plausible. Is there a way to partition the data into smaller chunks and then apply an FFT-based solution?
John E. Hadstate wrote:
...
> I suspect that the hardware that produced this recording > actually sampled the data as scalar, then converted it to > quadrature for recording by multiplying the scalar stream by > cos(Fs/4) and sin(Fs/4), etc. &#4294967295;Can I invert this process in the > time-domain without losing information and, if so, how?
Hello John There are many ways to convert a complex signal to a real signal without losing information (meaning that the one can be calculated from the other and vice versa). Whether any of those ways is useful to you I don't know (it depends on your application). For example, if you have a complex signal y[n], generated out of a real signal x[n] as y[n] = cos(pi/2 n) x[n] + i sin(pi/2 n) x[n] then it is rather simple to get x[n] from y[n]: / Re{y[n} (-1)^(n/2), n even x[n] = \ Im{y[n]} (-1)^((n-1)/2), n odd. Somehow, I don't think this helps you. Regards, Andor
On Fri, 25 Jan 2008 05:43:16 -0500, "John E. Hadstate"
<jh113355@hotmail.com> wrote:

> >"Rune Allnor" <allnor@tele.ntnu.no> wrote in message >news:7a5b10e6-ece6-4b6a-8ed2-97362b5113e7@u10g2000prn.googlegroups.com... > >> >> N = length(x); % x contains complex-valued data >> X = fft(x); >> yy = ifft(x,2*N); >> y = 2*real(yy); >> >> It is left as an excercise for the reader to implement >> this directly in time domain... ;) [*] >> > >Perhaps I should have started with, "I was given a file that >was recorded at enormous expense by a committee that didn't >understand the implications of its choices and thought it was >being exceedingly clever by choosing to record complex >samples." The problem is that none of the analysis tools >available to us will process complex data directly in the way >we need to process it. For various reasons, telling the >committee to pound sand is not a viable option. Neither is it >possible to discard the recordings and re-record the data. > >I suspect that the hardware that produced this recording >actually sampled the data as scalar, then converted it to >quadrature for recording by multiplying the scalar stream by >cos(Fs/4) and sin(Fs/4), etc. Can I invert this process in the >time-domain without losing information and, if so, how? > >In my problem domain, N > 1 Gb. so an FFT-based solution on the >whole data set is not plausible. Is there a way to partition >the data into smaller chunks and then apply an FFT-based >solution?
Hi John, I'm thinkin' out loud here (which usually gets me into trouble): Maybe you could interpolate your orignal complex time samples by a factor of two, then multiply the interpolated sequence by e^(+j*pi/4) to have a positive-frequency-only complex signal. (That last step is merely upward freq translation.) Then just take the real part of that freq-translated signal. Good Luck, [-Rick-]
John E. Hadstate wrote:
> > "Rune Allnor" <allnor@tele.ntnu.no> wrote in message > news:7a5b10e6-ece6-4b6a-8ed2-97362b5113e7@u10g2000prn.googlegroups.com... > >> >> N = length(x); % x contains complex-valued data >> X = fft(x); >> yy = ifft(x,2*N); >> y = 2*real(yy); >> >> It is left as an excercise for the reader to implement >> this directly in time domain... ;) [*] >> > > Perhaps I should have started with, "I was given a file that was > recorded at enormous expense by a committee that didn't understand the > implications of its choices and thought it was being exceedingly clever > by choosing to record complex samples." The problem is that none of the > analysis tools available to us will process complex data directly in the > way we need to process it. For various reasons, telling the committee > to pound sand is not a viable option. Neither is it possible to discard > the recordings and re-record the data. > > I suspect that the hardware that produced this recording actually > sampled the data as scalar, then converted it to quadrature for > recording by multiplying the scalar stream by cos(Fs/4) and sin(Fs/4), > etc. Can I invert this process in the time-domain without losing > information and, if so, how? > > In my problem domain, N > 1 Gb. so an FFT-based solution on the whole > data set is not plausible. Is there a way to partition the data into > smaller chunks and then apply an FFT-based solution?
Do you know for a fact that they didn't simply call even sample "real" and odd samples "imaginary"? Some complex sampling can be done that way, and a fondness for ignorant cleverness might have led them there. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:

(snip)

> Do you know for a fact that they didn't simply call even sample "real" > and odd samples "imaginary"? Some complex sampling can be done that way, > and a fondness for ignorant cleverness might have led them there.
Would there be some -1 factors in there, too? That is, (real, imaginary, -real, -imaginary) cycle. That would come from exp(i w t) for the appropriate w and t. -- glen
"Rick Lyons" <R.Lyons@_BOGUS_ieee.org> wrote in message 
news:8dshu3th75k1hr6kfjrtrhfm11t5k51km5@4ax.com...
> > Hi John, > I'm thinkin' out loud here (which usually gets me into > trouble): > Maybe you could interpolate your orignal complex time > samples by a factor of two, then multiply the > interpolated sequence by e^(+j*pi/4) to have a > positive-frequency-only complex signal. (That last > step is merely upward freq translation.) Then just > take the real part of that freq-translated signal. >
This actually works quite well! Thanks.