Hello, everyone. I would like some advice on creating a relatively simple digital downconverter for the purpose of listening to bat chirps. What I would like is to sample an input frequency range of 2kHz to 100kHz and down convert a particular point within that band down to around 2kHz. The selection of the target frequency to shift would be made with some sort of real-time user control. I was also hoping that there might be an algorithm that could be implemented on something like an 8-bit or 16-bit microcontroller using integer math only since those architectures are what I am most comfortable with. I appreciate any guidance anyone has about this project. Thanks, Eric
Simple digital audio downconverter algorithm
Started by ●September 21, 2011
Reply by ●September 21, 20112011-09-21
Reply by ●September 21, 20112011-09-21
EK <etk@hotmail.com> wrote:> I would like some advice on creating a relatively simple digital > downconverter for the purpose of listening to bat chirps.> What I would like is to sample an input frequency range of 2kHz to 100kHz > and down convert a particular point within that band down to around 2kHz.More obvious to me, just scale down the whole signal. The original must be sampled at more than 200kHz. If you play that at 44.1kHz, then all frequencies scale down by a factor of 200/44.1. That should get most of it within the audio range. (I will guess that someone rounded up for the 100kHz limit, but maybe not.) -- glen
Reply by ●September 21, 20112011-09-21
On 21.9.11 4:36 , EK wrote:> Hello, everyone. > > I would like some advice on creating a relatively simple digital > downconverter for the purpose of listening to bat chirps. > > What I would like is to sample an input frequency range of 2kHz to > 100kHz and down convert a particular point within that band down to > around 2kHz. The selection of the target frequency to shift would be > made with some sort of real-time user control. I was also hoping that > there might be an algorithm that could be implemented on something like > an 8-bit or 16-bit microcontroller using integer math only since those > architectures are what I am most comfortable with. > > I appreciate any guidance anyone has about this project. > > Thanks, > EricYou're asking for a digital radio receiver. To handle the bandwidth you need a sample rate over two times the maximum input required. (There are methods for using undersampling, but they need more stringent input filters). The rough outline is: - filter and maybe pre-amplify input to limit the frequency components to well below the Nyquist limit (half of sample frequency), - create sine and cosine copies of a local oscillator for determining the desired center frequency. - multiply the input signal in two channels, one with the sine signal and the other with the cosine signal - decimate both channels to a lower sample rate, - combine channels, with 90 degree phase shift (Hilbert transform). There are ready chips for the process, e.g. the Intersil HSP50016. --- Many of the bat detectors available commercially are far simpler analog things, with a simple analog mixer for frequency translation. -- Tauno Voipio
Reply by ●September 21, 20112011-09-21
EK wrote:> Hello, everyone. > > I would like some advice on creating a relatively simple digital > downconverter for the purpose of listening to bat chirps.1. What is good about bat chirps? 2. Doing this digitally requires a healthy DSP. The simplest would be an analog downconverter using a micro for LO generation. If SSB downconversion is desired, that would be a Weaver demodulator.> What I would like is to sample an input frequency range of 2kHz to > 100kHz and down convert a particular point within that band down to > around 2kHz. The selection of the target frequency to shift would be > made with some sort of real-time user control. I was also hoping that > there might be an algorithm that could be implemented on something like > an 8-bit or 16-bit microcontroller using integer math only since those > architectures are what I am most comfortable with. > > I appreciate any guidance anyone has about this project.How much is your appreciation? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●September 21, 20112011-09-21
"Vladimir Vassilevsky" <nospam@nowhere.com> wrote in message news:gsednaJsq6mehOfTnZ2dnUVZ_gudnZ2d@giganews.com...> > > EK wrote: > >> Hello, everyone. >> >> I would like some advice on creating a relatively simple digital >> downconverter for the purpose of listening to bat chirps. > > 1. What is good about bat chirps? > > 2. Doing this digitally requires a healthy DSP. > The simplest would be an analog downconverter using a micro for LO > generation. If SSB downconversion is desired, that would be a Weaver > demodulator.Thanks, Vladimir. My thinking I was stuck in the digital domain, but I see value of an analog downconverter since that is all I was really accomplishing with the digital method. I like the idea of using the micro for LO generation, so that may be a nice hybrid solution.>> What I would like is to sample an input frequency range of 2kHz to 100kHz >> and down convert a particular point within that band down to around 2kHz. >> The selection of the target frequency to shift would be made with some >> sort of real-time user control. I was also hoping that there might be an >> algorithm that could be implemented on something like an 8-bit or 16-bit >> microcontroller using integer math only since those architectures are >> what I am most comfortable with. >> >> I appreciate any guidance anyone has about this project. > > How much is your appreciation?I'll let you have one of my bats for free! Shipping costs are additional, however they might be able to ship themselves (if they don't get lost) :-) Eric
Reply by ●September 21, 20112011-09-21
"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message news:j5d3uj$8bo$1@speranza.aioe.org...> EK <etk@hotmail.com> wrote: > >> I would like some advice on creating a relatively simple digital >> downconverter for the purpose of listening to bat chirps. > >> What I would like is to sample an input frequency range of 2kHz to 100kHz >> and down convert a particular point within that band down to around 2kHz. > > More obvious to me, just scale down the whole signal. The original > must be sampled at more than 200kHz. If you play that at 44.1kHz, > then all frequencies scale down by a factor of 200/44.1. That should > get most of it within the audio range. (I will guess that someone > rounded up for the 100kHz limit, but maybe not.)That's in interesting idea, Glen, and I had not considered bulk scaling via sample rate adjustment. I might give that a try since it should be straightforward. Eric
Reply by ●September 21, 20112011-09-21
maybe one thought: Downconversion by frequency shifting destroys the harmonic relationship between tones in the signal. I don't think it will sound very pleasant, more like bat-out-of-hell... Time stretching might work, using some real-time pitch shifting algorithm. As a very simple algorithm, record (for example) 10000 samples, play back the first 2500, throw away the remaining ones and implement some kind of cross-fading to the next chunk. This won't be audiophile, but the result should make some sense to the ear.
Reply by ●September 21, 20112011-09-21
"mnentwig" <markus.nentwig@n_o_s_p_a_m.renesasmobile.com> wrote in message news:1cqdnb1vb8Np0-fTnZ2dnUVZ_gCdnZ2d@giganews.com...> maybe one thought: Downconversion by frequency shifting destroys the > harmonic relationship between tones in the signal. > I don't think it will sound very pleasant, more like bat-out-of-hell...Good point about the harmonic relationship getting destroyed. I'm not sure what that might do to my intended signal, and hopefully wouldn't be too bat-out-of-hellish. As I thought about this some more I realized that this actually might help in instances where the frequency of the chirps covers several tens of kHz. I guess the frequency shifting has the added benefit of frequency compression as well, and while it causes distortions in the original waveform, those distortions might improve the usability of the data in this circumstance. Straight heterodyning (or downcoversion) might still produce a waveform whose frequency dynamic range has portions of the chirp that are beyond my hearing ability.> Time stretching might work, using some real-time pitch shifting algorithm. > > > As a very simple algorithm, record (for example) 10000 samples, play back > the first 2500, throw away the remaining ones and implement some kind of > cross-fading to the next chunk. This won't be audiophile, but the result > should make some sense to the ear.Your point here was something I had wondered about with respect to frequency shifting as it seemed to me that some of the data would have to be thrown away at various intervals using that technique. Your idea about doing that in chunks might indeed be a sort of compromise to improve what is heard and I don't think the non-audiophile nature of the resultant waveform would be too bothersome. Eric
Reply by ●September 22, 20112011-09-22
On Sep 22, 1:36�am, "EK" <e...@hotmail.com> wrote:> Hello, everyone. > > I would like some advice on creating a relatively simple digital > downconverter for the purpose of listening to bat chirps. > > What I would like is to sample an input frequency range of 2kHz to 100kHz > and down convert a particular point within that band down to around 2kHz. > The selection of the target frequency to shift would be made with some sort > of real-time user control. �I was also hoping that there might be an > algorithm that could be implemented on something like an 8-bit or 16-bit > microcontroller using integer math only since those architectures are what I > am most comfortable with. > > I appreciate any guidance anyone has about this project. > > Thanks, > EricYou can do this in analogue. There are circuits going back 40 years. Local oscillator, multiplier,filter etc. Hardy






