DSPRelated.com
Forums

Frequency inversion using an FFT?

Started by Shafik September 28, 2004
Hello again,

As always, Im curious about something. Is it possible to implement
frequency inversion in the frequency domain?

Frequency inversion is defined here:
http://www.cescomm.co.nz/about/scrambling.html

Given that, can I take a signal and process it in real time, say in 64
sample chunks: Take the FFT, and simply "mirror" the values in the FFT
domain, and bring it back to the time domain using an IFFT?

Or would I run into time-domain aliasing and such. There was an earlier
post (about the brick-wall FFT filter) that mentioned that the
frequencies will only be defined at those 32 FFT points, and not in
between, would that also be a problem?

--Shafik

Hello Shafik,

The simplest frequency inversion can be had by simply inverting the sign of
every other sample. In this case you are convolving with 1,-1,1,-1,1, etc.
Now go over to the frequency domain and you will see that this convolution
is simply a frequency shift of one half of the sample rate. And since the
spectrum repeats, you get your inversion.

Clay



"Shafik" <shafik@u.arizona.edu> wrote in message
news:1096347278.211989.295470@k26g2000oda.googlegroups.com...
> Hello again, > > As always, Im curious about something. Is it possible to implement > frequency inversion in the frequency domain? > > Frequency inversion is defined here: > http://www.cescomm.co.nz/about/scrambling.html > > Given that, can I take a signal and process it in real time, say in 64 > sample chunks: Take the FFT, and simply "mirror" the values in the FFT > domain, and bring it back to the time domain using an IFFT? > > Or would I run into time-domain aliasing and such. There was an earlier > post (about the brick-wall FFT filter) that mentioned that the > frequencies will only be defined at those 32 FFT points, and not in > between, would that also be a problem? > > --Shafik >
You are completely right. However I was wondering if this could be done
specifically using an FFT. Im interested to see if it would cause
aliasing of some sort.

--Shafik

Clay Turner wrote:

> The simplest frequency inversion can be had by simply inverting the sign of > every other sample. In this case you are convolving with 1,-1,1,-1,1, etc. > Now go over to the frequency domain and you will see that this convolution > is simply a frequency shift of one half of the sample rate. And since the > spectrum repeats, you get your inversion.
As far as I know, it is traditionally done with a doubly balanced mixer, which multiplies a given signal by another, usually sinusoidal, signal. Somewhat similar to what you suggest. -- glen
"Shafik" <shafik@u.arizona.edu> wrote in message news:<1096353145.005151.107570@k26g2000oda.googlegroups.com>...
> You are completely right. However I was wondering if this could be done > specifically using an FFT. Im interested to see if it would cause > aliasing of some sort.
If it can be expressed in terms of a DFT, it can be implemented in terms of an FFT. I can't see any reason why manipulations in frequency domain would cause any problems, provided the manipulations perserve signal bandwidth and the speech signal has been properly filtered before being sampled. The main problem is how to merge blocks, get I/O buffers to work smoothly toghether, etc. From your thread about trouble-shooting FFT'ed data, I am sure you know everything about these sorts of things. Rune
On Tue, 28 Sep 2004 07:38:57 GMT, glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:

>Clay Turner wrote: > >> The simplest frequency inversion can be had by simply inverting the sign of >> every other sample. In this case you are convolving with 1,-1,1,-1,1, etc. >> Now go over to the frequency domain and you will see that this convolution >> is simply a frequency shift of one half of the sample rate. And since the >> spectrum repeats, you get your inversion. > >As far as I know, it is traditionally done with a doubly >balanced mixer, which multiplies a given signal by another, >usually sinusoidal, signal. Somewhat similar to what you >suggest. > >-- glen
It winds up being a mix that moves the negative image up to where the original signal was. This is why they describe the new image appearing. If you have the signal available in complex samples, i.e., I and Q, it's even easier to invert the spectrum. You can: Swap the I and Q channels so that I becomes Q and Q become I. Invert the I channel, i.e., I = -I. Invert the Q channel, i.e., Q = -Q. Any of those three techniques flip the spectrum about DC, effectively providing spectrum inversion. Swapping the I and Q channels seems to be the most hardware efficient means to do this. Eric Jacobsen Minister of Algorithms, Intel Corp. My opinions may not be Intel's opinions. http://www.ericjacobsen.org
"Clay Turner" <physics@bellsouth.net> wrote:

>Hello Shafik, > >The simplest frequency inversion can be had by simply inverting the sign of >every other sample. In this case you are convolving with 1,-1,1,-1,1, etc. >Now go over to the frequency domain and you will see that this convolution >is simply a frequency shift of one half of the sample rate. And since the >spectrum repeats, you get your inversion. >
Simplicity at it's best! Regards, Robert ( modify address for return email ) www.numbersusa.com www.americanpatrol.com
On Tue, 28 Sep 2004 18:11:06 GMT, eric.jacobsen@ieee.org (Eric
Jacobsen) wrote:

>On Tue, 28 Sep 2004 07:38:57 GMT, glen herrmannsfeldt ><gah@ugcs.caltech.edu> wrote: > >>Clay Turner wrote: >> >>> The simplest frequency inversion can be had by simply inverting the sign of >>> every other sample. In this case you are convolving with 1,-1,1,-1,1, etc. >>> Now go over to the frequency domain and you will see that this convolution >>> is simply a frequency shift of one half of the sample rate. And since the >>> spectrum repeats, you get your inversion. >> >>As far as I know, it is traditionally done with a doubly >>balanced mixer, which multiplies a given signal by another, >>usually sinusoidal, signal. Somewhat similar to what you >>suggest. >> >>-- glen
Hi Eric,
>It winds up being a mix that moves the negative image up to where the >original signal was. This is why they describe the new image >appearing.
Yep. I always view that inversion as a "flipping" of the spectrum where the "center of the flip" is Fs/4.
>If you have the signal available in complex samples, i.e., I and Q, >it's even easier to invert the spectrum. You can: > >Swap the I and Q channels so that I becomes Q and Q become I.
Also yes. If I remember correctly, that scheme induces a pi/2 phase shift in the spectral components of the "inverted" spectral components.
>Invert the I channel, i.e., I = -I. >Invert the Q channel, i.e., Q = -Q.
Humm, when I want to invert the spectrum of complex time samples, I just conjugate each time sample. I haven't seen that "inverting the I and the Q samples" method before. Interesting! I'll have to investigate that one. (snipped) See Ya', [-Rick-]
Rick,

Analog phones that I have examined that use frequency inversion for
security do not flip around Fs/4.  The problem is that the method of
multiplying by 1, -1, 1, ...  flips DC to Fs/4 and then the signal is
lowpass filtered when transmitted through the phone sysytem wiping out
a LOT of the ORIGINAL low frequency information. It would usually be
preferable to bandpass the signal with a narrow low freq stopband, a
wide high freq stopband, and frequency shift the data up before
flipping.

Dirk

Dirk Bell
DSP Consultant

r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message news:<415c974b.260935640@news.sf.sbcglobal.net>...
> On Tue, 28 Sep 2004 18:11:06 GMT, eric.jacobsen@ieee.org (Eric > Jacobsen) wrote: > > >On Tue, 28 Sep 2004 07:38:57 GMT, glen herrmannsfeldt > ><gah@ugcs.caltech.edu> wrote: > > > >>Clay Turner wrote: > >> > >>> The simplest frequency inversion can be had by simply inverting the sign of > >>> every other sample. In this case you are convolving with 1,-1,1,-1,1, etc. > >>> Now go over to the frequency domain and you will see that this convolution > >>> is simply a frequency shift of one half of the sample rate. And since the > >>> spectrum repeats, you get your inversion. > >> > >>As far as I know, it is traditionally done with a doubly > >>balanced mixer, which multiplies a given signal by another, > >>usually sinusoidal, signal. Somewhat similar to what you > >>suggest. > >> > >>-- glen > > Hi Eric, > > >It winds up being a mix that moves the negative image up to where the > >original signal was. This is why they describe the new image > >appearing. > > Yep. I always view that inversion as a "flipping" of the spectrum > where the "center of the flip" is Fs/4. > > >If you have the signal available in complex samples, i.e., I and Q, > >it's even easier to invert the spectrum. You can: > > > >Swap the I and Q channels so that I becomes Q and Q become I. > > Also yes. If I remember correctly, that scheme induces > a pi/2 phase shift in the spectral components of the > "inverted" spectral components. > > >Invert the I channel, i.e., I = -I. > >Invert the Q channel, i.e., Q = -Q. > > Humm, when I want to invert the spectrum of complex > time samples, I just conjugate each time sample. > I haven't seen that "inverting the I and the Q samples" > method before. Interesting! I'll have to investigate > that one. > > (snipped) > > See Ya', > [-Rick-]
Hello Dirk,

I would hope that the use of frequency inversion is not for security, since
it is easily broken. However, the mult by 1,-1,1,-1 etc,
maps DC to fs/2 and not fs/4. So DC shows up at 4kHz assuming the standard
phone sampling rate of 8kHz. Since the telco's passband is nominally 300 to
3400 Hz, so yes they would filter out some of the low frequency (original
domain) info. But one would hope that any real secure phone uses a more
robust method and hopefully one that changes with time.

Clay



"Dirk Bell" <dirkman@erols.com> wrote in message
news:6721a858.0410010801.3bee53b7@posting.google.com...
> Rick, > > Analog phones that I have examined that use frequency inversion for > security do not flip around Fs/4. The problem is that the method of > multiplying by 1, -1, 1, ... flips DC to Fs/4 and then the signal is > lowpass filtered when transmitted through the phone sysytem wiping out > a LOT of the ORIGINAL low frequency information. It would usually be > preferable to bandpass the signal with a narrow low freq stopband, a > wide high freq stopband, and frequency shift the data up before > flipping. > > Dirk > > Dirk Bell > DSP Consultant > > r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message
news:<415c974b.260935640@news.sf.sbcglobal.net>...
> > On Tue, 28 Sep 2004 18:11:06 GMT, eric.jacobsen@ieee.org (Eric > > Jacobsen) wrote: > > > > >On Tue, 28 Sep 2004 07:38:57 GMT, glen herrmannsfeldt > > ><gah@ugcs.caltech.edu> wrote: > > > > > >>Clay Turner wrote: > > >> > > >>> The simplest frequency inversion can be had by simply inverting the
sign of
> > >>> every other sample. In this case you are convolving with
1,-1,1,-1,1, etc.
> > >>> Now go over to the frequency domain and you will see that this
convolution
> > >>> is simply a frequency shift of one half of the sample rate. And
since the
> > >>> spectrum repeats, you get your inversion. > > >> > > >>As far as I know, it is traditionally done with a doubly > > >>balanced mixer, which multiplies a given signal by another, > > >>usually sinusoidal, signal. Somewhat similar to what you > > >>suggest. > > >> > > >>-- glen > > > > Hi Eric, > > > > >It winds up being a mix that moves the negative image up to where the > > >original signal was. This is why they describe the new image > > >appearing. > > > > Yep. I always view that inversion as a "flipping" of the spectrum > > where the "center of the flip" is Fs/4. > > > > >If you have the signal available in complex samples, i.e., I and Q, > > >it's even easier to invert the spectrum. You can: > > > > > >Swap the I and Q channels so that I becomes Q and Q become I. > > > > Also yes. If I remember correctly, that scheme induces > > a pi/2 phase shift in the spectral components of the > > "inverted" spectral components. > > > > >Invert the I channel, i.e., I = -I. > > >Invert the Q channel, i.e., Q = -Q. > > > > Humm, when I want to invert the spectrum of complex > > time samples, I just conjugate each time sample. > > I haven't seen that "inverting the I and the Q samples" > > method before. Interesting! I'll have to investigate > > that one. > > > > (snipped) > > > > See Ya', > > [-Rick-]