0
\$\begingroup\$

What I'd like to do is create headphones that record external audio with a wide frequency range, and remap that range into a range that's human audible.

The only way I can think to do this is to do a Fourier transform on the incoming audio, shift/compress the chart, and then do a reverse Fourier transform to create output audio.

Is there an analog method to do this? Searching "analog methods to compress audio frequency range" is turning up nothing, so perhaps I'm just using the wrong terminology?

If this is not possible. Is there a practical digital approach? My assumption is that it would be to use a sliding DFT, which as I understand it is basically an iterative FFT. Transform the result, and then do sliding DFT in reverse to create audio. However I'm not sure that the last part is actually possible. Is it?

\$\endgroup\$
9
  • \$\begingroup\$ Yes. I think they do something similar with bat detectors. The words that come to mind are things like "mixing" and "super-heterdyne" like radios. bats.org.uk/about-bats/bat-detectors-1/heterodyne. I suppose you could also record it on magnetic tape and play it back slower. \$\endgroup\$
    – DKNguyen
    Sep 16, 2021 at 3:54
  • 2
    \$\begingroup\$ I would like this to work in realtime if possible. I'm aware of heterodyning, but as far as I can tell that can only shift the frequency range, not compress it. I suppose that's something. \$\endgroup\$
    – Drew
    Sep 16, 2021 at 3:59
  • \$\begingroup\$ @Drew Are you talking about companding? \$\endgroup\$
    – jonk
    Sep 16, 2021 at 5:34
  • 1
    \$\begingroup\$ @jonk That's not it. To put it another way, I'm trying to take the frequency range 0-20khz and map it to 0-5khz (made up numbers). So for example an input tone of 16khz would result in an output tone of 4khz with the same amplitude. It should also be able to transform complex waveforms (sound). \$\endgroup\$
    – Drew
    Sep 16, 2021 at 5:40
  • 1
    \$\begingroup\$ @AjN The application is the first sentence in the question. It's a pair of headphones that shifts frequencies, allowing humans to perceive sounds normally outside of our hearing range. My goal is for it to work in real time, so it will not be a simple stretch of the waveform. \$\endgroup\$
    – Drew
    Sep 17, 2021 at 2:02

2 Answers 2

4
\$\begingroup\$

There are two classes of frequency shift operation - linear/additive, and multiplicative.

With linear shifting, you take a block of one frequency, and shift it linearly keeping the same bandwidth to another frequency, using a mixer. This is how 'bat detectors' work. It is trivial to do in real time with mixer hardware. The technique destroys harmonic relationships, so renders speech less intelligible. As it keeps the same bandwidth, in order to compress audio you need to run several shifters in parallel, taking their input from a different high part of the spectrum and superimposing them into the audio bandwidth.

Multiplicative shifting was traditionally done offline, by taking a recording and playing it back at a different speed, albeit with an associated duration scaling. However with software, it can be done in real time without a time scaling, Auto-Tune being the most famous example. As it analyses the incoming audio for frequency content and resynthesises the output, it's essentially working the way you suggest, of 'FFT, transform, then reverse DFT'. However, if not done carefully, voices take on an 'Alvin and the Chipmunks' sound, and much knowhow goes into the design of the operations around the transform steps to retain a good sound, see this

\$\endgroup\$
2
  • \$\begingroup\$ This gives me some more keywords to dig into thanks. Sounds like I will likely have to take a digital approach. I hadn't considered the idea of taking higher frequencies and simply playing them over the lower ones after linearly reducing them. ..that might actually work ok and it would have the added benefit of not distorting human speech. \$\endgroup\$
    – Drew
    Sep 16, 2021 at 5:27
  • \$\begingroup\$ Auto-Tune... the worst thing to happen to music since, well, ever. I should also mention that some karaoke machines use pitch shifting too, with excessive amounts of it resulting in that same 'drunken robot' effect that became oh-so-popular with the (mis) use of Auto-Tune. \$\endgroup\$ Sep 16, 2021 at 16:14
1
\$\begingroup\$

The superheterodyne approach may be OK but the issue there may be with your requirement if "wide frequency range". The frequency deviation would be only shifted in frequency. If your target audible range would be (as an example) 1kHz .. 9kHz that defines your bandwidth as 8kHz (or FM frequency deviation +/- 4kHz). Though this is a good chunk of the human hearing range when you would want to center let's say around 20kHz at your input the range you are "mapping" to the audible range. Your input frequency range would be relatively narrow (16kHz .. 24kHz) and that may not be what you needed.

If you want to use analog approach and cover higher (or smaller) frequency range you may use frequency to voltage convertor and drive a voltage controlled oscillator (VCO) to produce the output. The main caveat here is that this would work only for a single frequency and not entire spectrum. Adding just for completeness though it is unlikely going to fit the bill.

At the end you may realize that any analog approach is likely to be more complicated than what you already listed: Fourier transformation. Luckily FFT algorithms are widely available and always lead free :-)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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