Quadrature demodulation of FM

Before I ask my question, I’d like to thank everyone that’s been helping
out. I (and my peers at Purdue) are just starting out with the USRP and
really appreciate the support.

On to my question, I wrote a demodulation block for FM that uses a
different than the provided quadrature_demod_cf block. Here is a block
diagram of what I’m attempting:
http://pico.iis.u-tokyo.ac.jp/media/9/20060626-SQD-princ.jpg. I can
data from the USRP and successfully demodulate FM radio in MATLAB using
technique. However, I cannot accomplish this with my signal processing
I wrote. To test my block, I use the example wideband FM receiver code,
usrp_wfm_rcv.py, and basically insert my demodulation block in place of
provided demodulation block.

Here is the work code I made, note it is just a small modification of

int gr_quad_demod_baseband::work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
gr_complex *in = (gr_complex *) input_items[0];
float *out = (float *) output_items[0];
in++; // ensure that in[-1] is valid

for (int i = 0; i < noutput_items; i++){
    float I_1 = real(in[i-1]);
    float I_2 = real(in[i]);
    float Q_1 = imag(in[i-1]);
    float Q_2 = imag(in[i]);

    float dI = I_1 - I_2;
    float dQ = Q_1 - Q_2;

    float dQxI = dQ*I_1;
    float dIxQ = dI*Q_1;

    out[i] = d_gain*(dIxQ - dQxI);

return noutput_items;


The demodulation is really simple and if you do not get it at first,
check out the link to the block diagram. On a final note, my block is
running very slowly. I continuously get overrun notifications (I believe
that is the meaning of uO). I think I am quite close to the answer, I
need a little guidance. Anyone have any suggestions? Thanks in advance!

Jon Pendlum
Purdue University Undergraduate Student

I think you want to look at Richard Lyon’s book on DSP, Fig 13-61(b).
The book should be on the recommended reading list for GNU Radio. I
think this is an implementation of the algorithm you are trying to

I’ve used this method successfully with the OSSIE SCA code from VT.
Unfortunately that code is behind a silly click through system, but
I’m copying this code to an open repository next week. If you have
more questions, email me next week.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs