DSPRelated.com
Forums

Help - brain block!

Started by rufus November 10, 2003
Hello,
If someone could just point me in the right direction I would appreciate it.
I have built a real-time signal modulation simulator. I extract data from
the sound card buffer, modulate it, then display it freq components on a GUI
(spec an). Here is my dilema.

I am trying to do ssb - I have the formula. Now what is the easiest way to
convert the real samples into complex numbers? Currently I have to do a fft
and an ifft. Isn't there an easier way? I want to build a look-up table. I
believe it would have to have two dims.

My problem is I am not getting the math to convert from a sequence of real
samples to complex. I have read, and even gone back to my textbooks. I know
it must be simple. But I am sufferring from a real bad case of brain block!

Just for an exercise I tried to convert from real to polar and then to
complex. Without much luck.


 Thanks,
Bill


The real samples are already complex numbers -- they just have the imaginary
part equal to zero.


But how do I do SSB modulation the matlab formula is

x.*cos(2*pi*Fc*t) + imag(hilbert(x)).*sin(2*pi*Fc*t);

If I use the imaginary value of 0 1 will basically have an AM signal









"Matt Timmermans" <mt0000@sympatico.nospam-remove.ca> wrote in message
news:D9Nrb.2804$fB3.256722@news20.bellglobal.com...
> The real samples are already complex numbers -- they just have the
imaginary
> part equal to zero. > >
Hello Rufus,
The old standard way was to amplitude modulate (balanced mix)[1] a carrier
with the audio and then run through a filter to either pick just the upper
or the lower sideband. In a DSP type of situation, you can create a
quadrature carrier and mix it with an analytic form of the audio[2]. Thus
you only create either the upper of lower sideband as needed. The analytic
signal can be created with a delay and a Hilbert transformer, but more
commonly done is to pass the audio through a phase orthonal pair of
filters[3]. The filters have the same magnitude response but their phase
shifts differ by 90 degrees.

IHTH,

Clay

[1] A balanced mix means that when you multiply one signal with the other
you are capable of multipling by negative numbers. In standard AM, the audio
is given a DC offset so that the resulting signal is always nonnegative and
therefore when you multiply the carrier with it, you only multiply by
positive numbers. This is why standard AM yields unmodulated carrier in
addition to both the upper and lower sidebands. To understand just use so
trigonometry to expand:

(sin(wt)+1)*cos(ft)     unbalanced mix

sin(wt)*cos(ft)           balanced mix.

Now seeing that your source signal can be expanded into sines and cosines
via Fourier's thoerem, you can see how the mixing still works.

[2] Look up the Heaviside thoerem for frequency shifting with Fourier
transforms. It basically says multiplication by a complex exponential in one
domain is shifting in the other domain.

[3] An analytic signal while commonly described as having its imaginary
portion equal to the Hilbert transform of its real part, has the neat
property of having a one sided Fourier transform. So taking an analytic
signal version of the voice and shifting via Heaviside's theorem, you can
see how this directly produces SSB signals.







"rufus" <r111ufus@hotmail.com> wrote in message
news:vqv2s1mspjqjb8@corp.supernews.com...
> Hello, > If someone could just point me in the right direction I would appreciate
it.
> I have built a real-time signal modulation simulator. I extract data from > the sound card buffer, modulate it, then display it freq components on a
GUI
> (spec an). Here is my dilema. > > I am trying to do ssb - I have the formula. Now what is the easiest way to > convert the real samples into complex numbers? Currently I have to do a
fft
> and an ifft. Isn't there an easier way? I want to build a look-up table. I > believe it would have to have two dims. > > My problem is I am not getting the math to convert from a sequence of real > samples to complex. I have read, and even gone back to my textbooks. I
know
> it must be simple. But I am sufferring from a real bad case of brain
block!
> > Just for an exercise I tried to convert from real to polar and then to > complex. Without much luck. > > > Thanks, > Bill > >
Thanks - found some great links to "analytical signal"
"Clay S. Turner" <physics@bellsouth.net> wrote in message
news:2lSrb.82890$un.51136@bignews6.bellsouth.net...
> Hello Rufus, > The old standard way was to amplitude modulate (balanced mix)[1] a carrier > with the audio and then run through a filter to either pick just the upper > or the lower sideband. In a DSP type of situation, you can create a > quadrature carrier and mix it with an analytic form of the audio[2]. Thus > you only create either the upper of lower sideband as needed. The analytic > signal can be created with a delay and a Hilbert transformer, but more > commonly done is to pass the audio through a phase orthonal pair of > filters[3]. The filters have the same magnitude response but their phase > shifts differ by 90 degrees. > > IHTH, > > Clay > > [1] A balanced mix means that when you multiply one signal with the other > you are capable of multipling by negative numbers. In standard AM, the
audio
> is given a DC offset so that the resulting signal is always nonnegative
and
> therefore when you multiply the carrier with it, you only multiply by > positive numbers. This is why standard AM yields unmodulated carrier in > addition to both the upper and lower sidebands. To understand just use so > trigonometry to expand: > > (sin(wt)+1)*cos(ft) unbalanced mix > > sin(wt)*cos(ft) balanced mix. > > Now seeing that your source signal can be expanded into sines and cosines > via Fourier's thoerem, you can see how the mixing still works. > > [2] Look up the Heaviside thoerem for frequency shifting with Fourier > transforms. It basically says multiplication by a complex exponential in
one
> domain is shifting in the other domain. > > [3] An analytic signal while commonly described as having its imaginary > portion equal to the Hilbert transform of its real part, has the neat > property of having a one sided Fourier transform. So taking an analytic > signal version of the voice and shifting via Heaviside's theorem, you can > see how this directly produces SSB signals. > > > > > > > > "rufus" <r111ufus@hotmail.com> wrote in message > news:vqv2s1mspjqjb8@corp.supernews.com... > > Hello, > > If someone could just point me in the right direction I would appreciate > it. > > I have built a real-time signal modulation simulator. I extract data
from
> > the sound card buffer, modulate it, then display it freq components on a > GUI > > (spec an). Here is my dilema. > > > > I am trying to do ssb - I have the formula. Now what is the easiest way
to
> > convert the real samples into complex numbers? Currently I have to do a > fft > > and an ifft. Isn't there an easier way? I want to build a look-up table.
I
> > believe it would have to have two dims. > > > > My problem is I am not getting the math to convert from a sequence of
real
> > samples to complex. I have read, and even gone back to my textbooks. I > know > > it must be simple. But I am sufferring from a real bad case of brain > block! > > > > Just for an exercise I tried to convert from real to polar and then to > > complex. Without much luck. > > > > > > Thanks, > > Bill > > > > > >
"rufus" <r111ufus@hotmail.com> wrote in message
news:vqvota93cd1030@corp.supernews.com...
> But how do I do SSB modulation the matlab formula is > > x.*cos(2*pi*Fc*t) + imag(hilbert(x)).*sin(2*pi*Fc*t); > > If I use the imaginary value of 0 1 will basically have an AM signal >
That formula is incorrect. You should remove the call to imag() and have just: x.*cos(2*pi*Fc*t) + hilbert(x).*sin(2*pi*Fc*t)
"Matt Timmermans" <mt0000@sympatico.nospam-remove.ca> wrote in message
news:jOWrb.3873$fB3.357881@news20.bellglobal.com...
> > x.*cos(2*pi*Fc*t) + imag(hilbert(x)).*sin(2*pi*Fc*t); > > > > If I use the imaginary value of 0 1 will basically have an AM signal > > > > That formula is incorrect. You should remove the call to imag() and have > just:
Oh, actually, I see in the docs that your formula is correct, but the hilbert(x) function doesn't calculate the Hilbert transform -- it makes the analytic signal, so imag(hilbert(x)) is the hilbert transform of x, and will not be all zeros for real-valued input.
On Mon, 10 Nov 2003 05:58:34 -0700, "rufus" <r111ufus@hotmail.com>
wrote:

>Hello, >If someone could just point me in the right direction I would appreciate it. >I have built a real-time signal modulation simulator. I extract data from >the sound card buffer, modulate it, then display it freq components on a GUI >(spec an). Here is my dilema. > >I am trying to do ssb - I have the formula. Now what is the easiest way to >convert the real samples into complex numbers? Currently I have to do a fft >and an ifft. Isn't there an easier way? I want to build a look-up table. I >believe it would have to have two dims. > >My problem is I am not getting the math to convert from a sequence of real >samples to complex. I have read, and even gone back to my textbooks. I know >it must be simple. But I am sufferring from a real bad case of brain block! > >Just for an exercise I tried to convert from real to polar and then to >complex. Without much luck. > > > Thanks, >Bill >
Hi Bill, I tried to E-mail you a Hilbert transform paper that might help ya', but both of the following E-mail addresses "failed to deliver". r111ufus@hotmail.com rufus@hotmail.com [-Rick-]