Nyquist audio decoding query

Hey all,

Hope you are well.

(QUICK NOTE, I AM A NEWBIE!) Just a quick one, I was using the Nyquist prompt tool with the following command. From what I can see, it encodes well and changes the frequency to 16000Hz. When I use the same command to decode the audio I just encoded, it sounds extremely muffly…similar to telephone quality.

I am not in any way disrespecting the coder, I am just curious, is it supposed to sound like that? Will the audio also be muffled even at 16000Hz? (Although yes I am aware we won’t be able to hear it :grin: )

;nyquist plug-in
;version 4
;type process
;preview enabled
;name “Subliminal”
;debugbutton disabled
;author “Steve Daulton”
;release 2.4.2
;copyright “GNU General Public License v2.0+”

;; License: GPL v2 or later
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
;;
;; An audio frequency AM encoder / decoder for speech.
;; This is a simple form of Steganography (hiding information
;; within another message or physical object). It is a
;; popular method for creating “Silent Subliminals”.
;;
;; Disclaimer: The author makes no claims whatsoever regarding
;; the effectiveness or safety of “Silent Subliminals”.
;; Copyright Steve Daulton. http://audionyq.com


;control ACTION “Encode or Decode” choice “Encode,Decode” 0


; Global constants
(psetq *cf* 16000     ; Carrier frequency
       *lf* 300       ; Audio-band low frequency
       *hf* 3000      ; Audio-band high frequency
       *enc-gain* 5   ; Encoder gain
       *dec-gain* 4)  ; Decoder gain


(defun audio-filter (sig)
  (setf sig (highpass8 sig *lf*))
  (lowpass8 sig *hf*))


(defun modulate (sig)
  (mult sig (hzosc *cf*)))


(defun sideband-filter (sig)
  (dotimes (i 8 (mult  *enc-gain* sig))
    (setf sig (highpass8 sig (+ *cf* *lf*)))))


(defun encode (sig)
  (setf audio (audio-filter sig))
  (setf modulated (modulate audio))
  (multichan-expand #'limit (sideband-filter modulated)))


(defun decode (sig)
  (setf audio (mult *dec-gain* sig (hzosc *cf*)))
  (setf audio (lowpass8 audio *hf*))
  (multichan-expand #'limit audio))


(defun limit (sig &aux (limit 0.8) (hld 10.0))
  (let* ((time (/ hld 3000.0))  ; lookahead time (seconds)
         (samples (round (* time *sound-srate*)))
         (peak-env (get-env sig samples time limit)))
    (mult sig
      (snd-exp 
        (mult -1 (snd-log peak-env))))))


(defun get-env (sig step lookahead limit)
  (let* ((sig (mult (/ limit) sig))
         (pad-time (* 3 lookahead))       ; padding required at start (seconds)
         (pad-s (* 3 step))               ; padding samples
         (padding (snd-const (peak sig pad-s) 0 *sound-srate* pad-time))
         (peak-env (snd-avg sig (* 4 step) step OP-PEAK)))
    (extract 0 1
      (s-max 1 
        (sim padding
          (at-abs pad-time (cue peak-env)))))))


(cond ((< *sound-srate* 44100) "Error.\nTrack sample rate too low")
      ((= ACTION 0) (encode *track*))
      (t (decode *track*)))

Thank you for reading

Ray

Yes: it has a bandpass from 300Hz-3000Hz

lf 300 ; Audio-band low frequency
hf 3000 ; Audio-band high frequency

If the sample rate is 44100Hz, and the carrier is 16kHz, you could increase the high-band from 3000Hz to 6000Hz. The results would then be less muffled.

Thank you for the response, Trebor. I will do that.

Will it still work the same way as a subliminal? Subconscious mind picking up the audio without conscious mind picking it up? Apologies if this is a silly Q, new to all this :folded_hands:t3:

Equally ineffective … https://youtu.be/Z36TxAwFpMw

I respect that a lot of people don’t believe in this pseudoscience and thats fair enough :folded_hands: but in theory, for someone who believes in Subliminals, will it still work the same way as I queried above? “Subconscious mind picking up the audio without conscious mind picking it up?” even with the high-band changes?

If you can’t hear it, then your conscious mind is not picking it up.
If you can hear something, but can’t understand it, then your conscious mind is not picking it up.
If the decoded version is less muffled then mission accomplished.

Thank you Trebor, appreciate the help.

I added a “code block” (The </> button) around the code in your post to make it readable as code.

Yes it does, and the reason for that comes down to science. It can be summed up as:
“You can’t fit a gallon into a pint pot”

  • The absolute frequency limits for digital audio with 44100Hz sample rate is 0 to 22050Hz:

0---------------------------------------------------------------------------------------------------------------------22050

  • The audible frequency range is usually quoted as 20Hz to 20000Hz:

20----------------------------------------------------------------------------------------------------------------20000

  • Of that range, the part from around 50Hz to 16000 Hz is easy to hear:

50----------------------------------------------------------------------------------------16000

  • and of that, clear speech is mostly in the range 100 to around 8000 Hz:

100-------------------------------------------------8000

  • The idea of “silent subliminals” is that we somehow shift the speech frequencies up into the upper frequency range (above 16000Hz so they cannot easily be heard. This means shifting this range:

100-------------------------------------------------8000

into this range:

16000--------------------------22050

and as you can see, it won’t all fit.

The way that the plug-in works around this, is to use the “telephone range” of 300 to 3000Hz:

300-------------------------3000

which will just fit into the available range above 16000 Hz.

16000--------------------------22050

How about halfway between 3000Hz & 6000Hz

; Global constants
(psetq *cf* 16000     ; Carrier frequency
       *lf* 20       ; Audio-band low frequency
       *hf* 4500      ; Audio-band high frequency
       *enc-gain* 3   ; Encoder gain
       *dec-gain* 2)  ; Decoder gain