 # Wfm_pll decimation factors possibly wrong?

Hi all,
I am working with the wfm_pll code for the usrp_wfm_rcv_pll example.
What I don’t get is how it can work with the current decimation factors.
The usrp_decim=200 and the audio_decim=10
This results in all blocks outputting at 32 kS/s
Which results in -16, +16 Khz bandwith/niquist freqs.

But how can the stereo_carrier_recovery work.
It used the output of
self.stereo_carrier_filter = gr.fir_filter_fcc(audio_decimation,
stereo_carrier_filter_coeffs)
Which is a signal with a samplerate of 32 kS/s

The 19 kHz pilot_tone and the 38 kHz recovered carrier are outside the
niquist freq.(-16, +16 Khz)

I would expect that the audio_decimation should be much lower then 10
for this to work
See code snippets below,

Greetings,
Martin

in usrp_wfm_rcv_pll.py:
usrp_decim = 200
self.u.set_decim_rate(usrp_decim)
usrp_rate = adc_rate / usrp_decim # 320 kS/s
chanfilt_decim = 1
demod_rate = usrp_rate / chanfilt_decim
audio_decimation = 10
audio_rate = demod_rate / audio_decimation # 32 kHz

in blksimpl/wfm_pll.py:

audio_rate = demod_rate / audio_decimation

self.stereo_carrier_filter = gr.fir_filter_fcc(audio_decimation,
stereo_carrier_filter_coeffs)
self.rds_signal_filter = gr.fir_filter_fcc(audio_decimation,
stereo_rds_filter_coeffs)
self.stereo_dsbsc_filter = gr.fir_filter_fcc(audio_decimation,
stereo_dsbsc_filter_coeffs)

more snippets from blksimpl/wfm_pll.py:
# Pick off the stereo carrier/2 with this filter. It
attenuated 10 dB so apply 10 dB gain
# We pick off the negative frequency half because we want to
base band by it!
## NOTE THIS WAS HACKED TO OFFSET INSERTION LOSS DUE TO
DEEMPHASIS

``````        stereo_carrier_filter_coeffs =
``````

gr.firdes.complex_band_pass(10.0,
demod_rate,
-19020,
-18980,
width_of_transition_band,
gr.firdes.WIN_HAMMING)

``````        #print "len stereo carrier filter =
``````

",len(stereo_carrier_filter_coeffs)
#print "stereo carrier filter ",
stereo_carrier_filter_coeffs
#print "width of transition band =
",width_of_transition_band, " audio rate = ", audio_rate

``````        # Pick off the double side band suppressed carrier
``````

Left-Right audio. It is attenuated 10 dB so apply 10 dB gain

``````        stereo_dsbsc_filter_coeffs =
``````

gr.firdes.complex_band_pass(20.0,
demod_rate,
38000-15000/2,
38000+15000/2,
width_of_transition_band,
gr.firdes.WIN_HAMMING)
#print "len stereo dsbsc filter =
",len(stereo_dsbsc_filter_coeffs)
#print "stereo dsbsc filter ", stereo_dsbsc_filter_coeffs
# construct overlap add filter system from coefficients for
stereo carrier

``````        self.stereo_carrier_filter =
``````

gr.fir_filter_fcc(audio_decimation, stereo_carrier_filter_coeffs)

``````  self.rds_carrier_generator = gr.multiply_cc();
self.rds_signal_generator = gr.multiply_cc();
self_rds_signal_processor = gr.null_sink(gr.sizeof_gr_complex);

alpha = 5 * 0.25 * math.pi / (audio_rate)
beta = alpha * alpha / 4.0
max_freq = -2.0*math.pi*18990/audio_rate;
min_freq = -2.0*math.pi*19010/audio_rate;

self.stereo_carrier_pll_recovery =
``````

gr.pll_carriertracking_cc(alpha,beta,max_freq,min_freq);
self.stereo_carrier_pll_recovery.squelch_enable(False);

``````        # set up mixer (multiplier) to get the L-R signal at
``````

baseband

``````        self.stereo_basebander = gr.multiply_cc();

# pick off the real component of the basebanded L-R signal.
``````

The imaginary SHOULD be zero

``````        self.LmR_real = gr.complex_to_real();