IR Modulation Processing Algorithm Development – Part XV

In my last post on this (somewhat long-winded) subject, I described the implementation of a Teensy-based sweep generator utility for use in testing the band-pass filter (BPF) application, and showed some results from the 52Hz version of the BPF. As a result of this work, I believe I had validated both the test instrumentation and the 52Hz BPF implementation.

This post extends the previous work to the original goal for this project – the 520Hz BPF implementation. When I did the original work on the 520Hz version, it was clear there was something wrong, but not what. For reference, here are some representative plots from this 24 June 2017 post.

Temporarily reduced filter center freq from 520Hz to 52Hz to eliminate any possibility of timing problems due to Teensy 3.5 internal interrupts.

As the plots from the previous post showed, the 52Hz BPF implementation works as intended. So, it was time to try my hand (again!) with the 520Hz version. First, I did an elapsed time study, to make sure no sample periods were being missed. As the plot below shows, all the elapsed time values are reasonable, with only a few going to 101 μSec. I speculate that the 101 values may be due to execution of extra-long internal Teensy ISRs. The elapsed time plot conclusively demonstrates that something I did during the above list of changes eliminated the occasional (1 out of 68 or 69 cycles) missed sample that caused the previous ‘crappy’ results for the 520Hz version of the filter. My personal favorite for the culprit is one or more of the print statements I had in the original code for debugging.

Sample times vs time.

The next set of plots shows the results of an amplitude sweep, with the amplitude set to a fixed 50% p-p value

‘raw’ Final Values vs time, with fixed frequency, 50% p-p

’round-trip’ Final Values vs time, fixed freq, 50% p-p

detail of ‘raw’ pot

The above plots weren’t quite what I expected; both the ‘raw’ and ’round-trip’ final values were lower than expected, and the ‘raw’ plot had a lot more ripple than I wanted to see. This all led me to believe that the test frequency was not centered in the BPF passband. I had not actually double-checked this, so I went back a few steps and made sure the fixed amplitude sweep frequency was indeed synched with the demodulator sampling frequency. After that, the plots got a lot cleaner, as shown below.

‘raw’ final values vs time after synching Tx & Rx frequencies

In the above plot, the ‘raw’ final value is pretty steady around the value 1,320,000, which agrees well with a 50% p-p Tx level.

Next, I ran frequency sweeps, as shown in the following plots

‘raw’ Final Values vs frequency, with amplitude @ 50% p-p

’round-trip’ Final Values vs frequency, with amplitude @ 50% p-p

For reference, the same two plots for the 52Hz implementation are shown below