EMRFD Message Archive 3569

Message Date From Subject
3569 2009-09-26 02:38:28 ha5rxz NBFM
Dear board

This question has two parts:

1) If I have a signal generator with I & Q outputs and an I & Q audio signal how do I combine these to generate NBFM?

2) If I have an incoming signal which has been split into I & Q plus an I & Q output from a signal generator how do I combine these to demodulate NBFM?

HA5RXZ
3570 2009-09-26 07:37:29 Vojtech Re: NBFM
> 1) If I have a signal generator with I & Q outputs and an I & Q audio signal how do I combine these to generate NBFM?

Your question was not specific enough.

Ideally you would modulate your signal generator the same way one pulls the VXO with varactor. You will not need complex signals for it at all.

If you cannot do that, I would propose to do the same trick as with sideband modulation. Modulate a low frequency DVFO with your audio signal and upconvert it the same way you would modulate SSB.

There may be another trick, but I am not aware of any.

> 2) If I have an incoming signal which has been split into I & Q plus an I & Q output from a signal generator how do I combine these to demodulate NBFM?

1) Multiply the complex RF signal with your complex VFO signal to shift the RF frequency to baseband.

2) Low pass the complex baseband signal.

3) Calculate instaneous phase of the baseband signal
phase = atan2(Q/I)

4) Derivate the instaneous phase.
delta_phase = phase(time + 1) - phase(time)

There is a nice trick to the demodulator to avoid calculating atan2, which I read yesterday in
"Understanding digital signal processing" from Richard G. Lyons. I already have some basics of DSP. I think I can recommend the book to a beginner after couple of hours reading.

73, Vojtech AB2ZA, OK1IAK
3571 2009-09-26 07:39:48 Niels A. Moseley Re: NBFM
Hello HA5RXZ,

1)
You'll have to be a little bit more specific:

What kind of signal does your RF(?) signal generator generate?

What kind of (I/Q) audio signal do you have? An audio is not supplied as
a quadrature (I/Q) signal unless it has already been modulated.

While it is certainly possible to generate FM using I/Q signals, by far
the simplest way is to use a VCO and apply the audio signal to it's
voltage control input.

2)
Do you want to use digital or analog techniques to demodulate the NBFM?

73,
Niels PA1DSP.


> Dear board
>
> This question has two parts:
>
> 1) If I have a signal generator with I & Q outputs and an I & Q audio signal how do I combine these to generate NBFM?
>
> 2) If I have an incoming signal which has been split into I & Q plus an I & Q output from a signal generator how do I combine these to demodulate NBFM?
>
> HA5RXZ
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
3572 2009-09-26 10:12:26 ha5rxz Re: NBFM
Ah, this is the problem with this board, there are people here far brainier than me! Let me have another go at explaining the problem:

In EMRFD there are some designs for SSB receivers and transmitters, all of these use a pair of VFO signals 90 degrees apart and a pair of audio signals phase shifted by the same amount. Details are also given of ways to generate CW and to generate and receive AM.

Now, how do I use the same components to generate and receive NBFM?

Off board I have received one answer for receive which might work. By feeding the incoming RF I and Q signals into a single mixer I should be able to detect FM by carrying out phase detection as it operates as a quadrature detector. This is similar to the old FM detectors that used a quadrature coil or a PLL to generate the 90 degree phase shift.

The answer to generating an FM signal is still an unknown. Please note that my math skills are only at a basic level. All I therefore need are the connections for the mixer(s)

HA5RXZ
3573 2009-09-26 10:40:31 Thomas S. Knutsen Re: NBFM
To generate PM (Pulse modulation) you could do this:
Connect the I path to an mixer, and in the Q path you connect an resistor to
+12V.
This is outlined in the KK7B article about MicroT2.

73 de Thomas LA3PNA


2009/9/26 ha5rxz <ha5rxz@gmail.com>

>
>
> Ah, this is the problem with this board, there are people here far brainier
> than me! Let me have another go at explaining the problem:
>
> In EMRFD there are some designs for SSB receivers and transmitters, all of
> these use a pair of VFO signals 90 degrees apart and a pair of audio signals
> phase shifted by the same amount. Details are also given of ways to generate
> CW and to generate and receive AM.
>
> Now, how do I use the same components to generate and receive NBFM?
>
> Off board I have received one answer for receive which might work. By
> feeding the incoming RF I and Q signals into a single mixer I should be able
> to detect FM by carrying out phase detection as it operates as a quadrature
> detector. This is similar to the old FM detectors that used a quadrature
> coil or a PLL to generate the 90 degree phase shift.
>
> The answer to generating an FM signal is still an unknown. Please note that
> my math skills are only at a basic level. All I therefore need are the
> connections for the mixer(s)
>
> HA5RXZ
>
>
>



--

Please avoid sending me Word or PowerPoint attachments.
See <http://www.gnu.org/philosophy/no-word-attachments.html>


[Non-text portions of this message have been removed]
3576 2009-09-26 22:25:36 Ashhar Farhan Re: NBFM
let me attempt answering this in a way that i would do it (given my
inability to appreciate higher maths) ...apologies for posting a 'tutor' in
place of a simple reply.

*Transmission of NBFM*

*Step 1: Generate a single tone*

first, the given is the that we have quadrature I-Q phasing transmitter.
that means, it has the ability to generate SSB easily. All one has to do is
take an audio signal and generate another one from it that is 90 degrees out
of phase, then feed this to the I-Q mixer pairs (that are also being driven
by an RF source pair that is 90 degrees out of phase with each other) and we
have SSB coming out.

Alright, now, consider that we want to only generate a single tone at the
output of the SSB transmitter. So, most computer languages provide a
function that will give us the value of a sine function like this:

instantAmplitude = sine(phaseAtTheMoment);

Whatever you angle you feed to this function is returned as an amplitude at
that angle. so:

sine(0) will return 0
sine(45 degrees) will return 0.707
sine(90 degrees_ will return 1
etc.

once the value of the sinewave go over 360 degrees, the entire pattern will
repeat itself.
So, get to the values corresponding to the up and down of a sinewave, you
will repeatedly call this function like so

sine(0)
sine(4)
sine(8)
sine(12)
sine(16)
sine(20)
etc.

this, when fed to your soundcard will generate a sinewave at the audio's
output jack. depending upon how much the jump is between successive calls to
the sine function, your frequency will vary. Now, we have a programmable
sinewave generator. the jump between succesive calls to the sine function is
your 'tuning' word. this is effectively a DDS.

*Step 2: Generating two tones, 90 degrees of out phase *

but our I-Q system requires two of them, out of phase at 90 degrees with
each other. Easily done here is how

sine(0) -> to the left channel
sine(90) -> to the right channel
sine(4) -> to the left channel
sine(90 + 4) to the right channel
sine(8) to the left channel
sine(90 + 8) to the right channel
sine((12) to the left channel
sine(90 + 12) to the right channel
etc. ....

Effectively you call the sine function twice for each sample, in the second
sample, you constantly add 90 degrees more than you did to the first sample.

*Step 3: Making the frequency change as the amplitude of the signal*

The NBFM implies that the frequency of the transmission changes as the
amplitude of the modulating signal goes up and down. But, as we just saw
above, the frequency is controlled by adjusting the 'step size' of the
increment between calls to the sine function. So, in our case, to vary the
frequency, we have to control the step size. hence, suppose, our microphone
input is m, then our program will be like this:

start:
read mic's current amplitude into m
I channel = sine (x + m);
Q channel = sine (x + m + 90);
x = x + stepsize;
go back to start

This works very simply. as the amplitude at the mic goes up, the step size
of the sine wave generator increases, increasing the rate of change of the
phase, making the sinewave bob up and down faster, thereby frequency
modulating the signal.

Tips:
1. The audio from the mic, m will have to be scaled and limited to prevent
it from making the output vary too much.
2. I haven't talked of pre-emphasis etc. These will come later. Just get
something going first.

*Reception of NBFM*
*
*
*A zero crossing detector*

Reception of the NBFM is actually much simpler. But it might need some
conceptual understanding (rather than maths). Imagine that you have tuned to
the nbfm signal like a CW (morse code) transmission and that it is appearing
at a fixed frequency in our audio pass band (let's imagine that it is at 10
KHz).

As you analyze the incoming samples, you will figure out that they rise from
zero level, go positive, dip down again, cross over zero line go negative,
rise again and repeat themselves. So, the first trick is to keep looking at
packets waiting for them to go negative and then precisely at the moment
they cross negative to positive, note the precise time at which it happened.

Once we know the 'zero-crossing' time, we can now measure the distance
between the zero crossings. If the frequency is going down, the length of
time between the zero crossings will increase, if the frequency of the
signal is going up, the time periods between the zero crossings will
decrease. Hence, the time periods between successive zero crossings is
simply your demodulated FM!

*Why it won't work as it is.*
*
*
You'd be lucky if the signal crossed the zero line precisely at the time you
took the reading of that particular sample. Usually, you will get a result
like .. previous sample was -40, this sample is +20. Hence, the zero
crossing would have probably taken place about 2/3rds way between the two
samples (this is called extrapolation). So, you will have to extrapolate and
find out where the crossing took place between the two samples (this is
simple middle school maths).

The takeways are these: first, use more samples per second, have greater
resolution of the samples (your sound card should be at least 16 bits).


Don't try this at home
*
Go ahead and try it. I have lied on several accounts here but that is what
engineering modelling is all about -To hide the complexities until it's
really required to handle it.

Unfortunately, most of the SDR code we come across is too much of a
production code to be readable for self-education. Other code (including
that in EMRFD) is not in high level language that can be easily implemented
on the PCs. Try reading the gnuradio code if you can. I didn't have the
patience to go through it so I ended up writing my own for a few projects.

- Farhan (VU2ESE)

*


[Non-text portions of this message have been removed]