I have an audio file that is 6 seconds long. The file has a message hidden into it in the ultra high frequency range. I plot the Mel Spectrogram with a sample rate of 44100 and use a high-pass filter to filter the base signal, here is the mel spectrogram I've plotted before filtering and after filtering

Before Filtering

After Filtering

To filter, I've used the following code:

import librosa
from scipy import signal

x, sr = librosa.load(soundfile_4, sr=44100)
b = signal.firwin(101, cutoff=12000, fs=sr, pass_zero=False)
x = signal.lfilter(b, [1.0], x)

Here is a waveform plot of the filtered singnal:

enter image description here

My question is, after filtering, how do I bring the message down from the ultra high frequency range down to an audible range?! I know I am supposed to use amplitude demodulation, but don't quite have an idea how!!


If the "AM" is DSB-SC AM you would simply multiply by the carrier frequency and low pass filter in order to demodulate. We can determine more by observing your filtered signal with time (as a waveform) - including how to extract the carrier, can you plot that as well?

Short of that, assuming it is a DSB-SC AM modulation, I suggest the following as a simple demodulation technique (that I just made up so requires critique if this would actually work):

Multiply the filtered signal of the modulated signal alone by alternating an alternating sequence of +1 -1 at the sampling rate. This will invert the spectrum such as to move the modulated and spectrally symmetric waveform to a lower frequency (call it carrier-x, which given carrier at $f_1$ with Nyquist frequency $f_s/2$, carrier-x will be at $f_s/2-f_1$) where we can simply square the waveform (if DSB-SC) to determine the carrier frequency (meaning multiply the waveform with itself, as in $x^2$). This will produce a strong frequency at twice the carrier frequency with the modulation stripped. For post processed demodulation, play this extracted carrier at half the rate by inserting zeros between each sample (this will stretch out the recovered carrier to half rate, and produce additional carriers at harmonics, but I believe the subsequent filtering should reject those components so as to not require additional interpolation filtering), and then multiply this directly with the modulated signal at carrier-x. Low pass filter this result (given the plot the OP provided, a low pass filter at 1 KHz appears sufficient, but it should be less than $f_s/2-f_1$, and the intention is to block the doubled result that would appear at $2(f_s/2-f_1)$.

Unless it is known that this message is hidden audio, I would suspect that it is a data pattern, such as a signature tag.

  • $\begingroup$ I got a basic idea of what you are trying to get at here... How would that look like in python? Even pseudocode! This will help me understand better what is being done! $\endgroup$
    – Alan Judi
    Jun 29 '21 at 18:45
  • $\begingroup$ I'll do that if you could show your progress plots as there may be some gotchas along the way but curious how well it works. Can't today, however, maybe tomorrow. $\endgroup$ Jun 29 '21 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.