off-topic: aliasing artifacts from mobile modem (using librosa :-) )

65 views
Skip to first unread message

Peter Senna Tschudin

unread,
Feb 14, 2023, 7:45:22 AM2/14/23
to librosa
Hi,

I am highly confused. I am trying to understand how a mobile device, in my case a SIM7600G, alters the audio, and the more I investigate, the more I learn what I do not know.

Please let me know if this sort of question is off limits here, and I will stop. To my defense, the reference audio and the graphs were generated using librosa, but my question is not related to librosa.

The attachment ref.jpeg shows the reference signal, created using librosa.chirp to sine sweep from 30 Hz to 3400 Hz. The attachment deg.jpeg shows what I recorded after playing the audio trough the mobile device. The vertical lines intercept the original sine sweep at 1350Hz, 800Hz, 560Hz, and 440Hz. Do you see an obvious pattern here?

What confuses me is that the signal mostly went trough, but there are these artifacts that I guess are aliasing artifacts. Ideas of what is going on here?

My only guess is that there is a somewhat-dumb noise canceling algorithms trying to remove specific frequencies from the audio, completely blind to the fact the I am playing a sweep. But I am clueless.

Thank you,

Peter
deg.jpeg
ref.jpeg

Brian McFee

unread,
Feb 14, 2023, 9:01:13 AM2/14/23
to librosa
It's a bit off-topic for this forum, but it's interesting!

The downward sweeps are certainly aliasing artifacts.  The reflection at 4K indicates an 8KHz sampling rate (makes sense for your hardware), but you didn't mention the initial sampling rate of the signal.  I'm guessing it's doing some sample-rate conversion here, and the low-pass filter is not rejecting enough above the target Nyquist.  I imagine these would disappear if you generated the sweep at 8KHz natively, but that's something to check.  If so, it might make it easier to diagnose the rest of what's going on.

The vertical artifacts are more interesting.  Your hunch about noise cancellation might be correct - they appear evenly spaced in time (every 4.5 seconds or so), which for a log frequency sweep, should indicate that it's hitting integer multiples (harmonics) of some resonant frequency.  If not noise cancellation, it could be down to compression codecs, but that's just a guess and well outside my area of expertise.

Peter Senna Tschudin

unread,
Feb 15, 2023, 2:54:30 AM2/15/23
to librosa
Hi Brian,

I posted the same question stackexchange*, and someone immediately identified the issue as clipping. See how interesting:

ref = librosa.chirp(fmin=30, fmax=3400, sr=8000, length=30)
deg = load_raw_audio(deg.raw)
clip = np.clip(ref, -0.9, 0.9)

First ref:
ref.png
Then deg, which I recorded over the a phone call
deg.png

Now clip from np.clip(ref, -0.9, 0.9):
clip.png
The main thing I learned is that aliasing can have more than one cause. I knew about insufficient sample rate, and now I added clipping to the list of possible causes. To "solve" the issue, I multiplied the reference file by 0.4 to reduce the amplitude, and this is what I got:
degraded_low_volume.png
Now I can start trying to understand what is going on with the modem, and how it degrades the audio. The likely cause of the clipping was that the digital land line and the mobile modem involved in the call had a mismatch of their dynamic ranges. Lowering the transmitting volume solved the issue.

Thank you for the hints about the vertical artifacts, and let me know if you have ideas on how to debug further. I will post here when I find out what is the cause.

Thank you Brian!

[...]
Reply all
Reply to author
Forward
0 new messages