Ok, this is slightly offtopic, but relates to the quality of input for speex :) I'm working on echo cancellation by means of sampling the wave mix of the sound card as well as the microphone. I originally had two sound cards, which had some synchronization problems (now solved, more or less), but I have also discovered a much better solution using ASIO 2.0, which enables me to sample multiple sources on the same soundcard. Unfortunately, ASIO is limited to the internal sampling frequency of the sound card, which for my Audigy 2 is 48 khz, and only delivers stereo. As I understand it, just picking every 3rd sample and averaging left and right will introduce aliasing, so I added a FIR-filter to remove all components above 7.5 khz before downsampling. While I can't say I really notice any difference in audible audio quality, the samples seem to have slightly better SNR when inspected in various audio programs. However, I still downmix to mono by just averaging the left and right samples, which (from my googling) I can tell will introduce aliasing but I found no good highquality solution to this :( The question is, is this FIR-decimator the best method to downsample? I thought of converting the frame to the frequency domain, drop components> 8khz and convert back, but I'm not sure if that would produce abetter signal or worse. Also, would it be best to do echo cancellation and preprocessing at 48khz and then decimate to 16khz, or (as I currently do) decimate first then do echo cancellation and preprocessing?
Hi, For transforming stereo to mono, averaging is fine and that's what everybody does. For sampling rate conversion, it's another matter (too long for this email) and you should read a bit about it a perhaps grab a library that does that. As for echo cancellation, it will be less complex (and as good) on a (cleanly) down-sampled signal (and certainly not on stereo). Jean-Marc Le mardi 07 juin 2005 ? 22:16 +0200, Thorvald Natvig a ?crit :> Ok, this is slightly offtopic, but relates to the quality of input for > speex :) > > I'm working on echo cancellation by means of sampling the wave mix > of the sound card as well as the microphone. I originally had two sound > cards, which had some synchronization problems (now solved, more or > less), but I have also discovered a much better solution using ASIO 2.0, > which enables me to sample multiple sources on the same soundcard. > > Unfortunately, ASIO is limited to the internal sampling frequency of the > sound card, which for my Audigy 2 is 48 khz, and only delivers stereo. As > I understand it, just picking every 3rd sample and averaging left and > right will introduce aliasing, so I added a FIR-filter to remove all > components above 7.5 khz before downsampling. While I can't say I really > notice any difference in audible audio quality, the samples seem to have > slightly better SNR when inspected in various audio programs. > > However, I still downmix to mono by just averaging the left and right > samples, which (from my googling) I can tell will introduce aliasing but I > found no good highquality solution to this :( > > The question is, is this FIR-decimator the best method to downsample? I > thought of converting the frame to the frequency domain, drop components > > 8khz and convert back, but I'm not sure if that would produce a > better signal or worse. > > Also, would it be best to do echo cancellation and preprocessing at 48khz > and then decimate to 16khz, or (as I currently do) decimate first then do > echo cancellation and preprocessing? > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev >-- Jean-Marc Valin <Jean-Marc.Valin@USherbrooke.ca> Universit? de Sherbrooke
> For transforming stereo to mono, averaging is fine and that's what > everybody does. For sampling rate conversion, it's another matter (too > long for this email) and you should read a bit about it a perhaps grab a > library that does that.Working on it :) As far as I can see, as long as I do downsampling by an integer factor, the FIR-filter decimator should do the job with a minimum of distortion and aliasing. On a sidenote, people might want to be aware that many soundcards work internally at some specified frequency (usually 48 khz) and if you sample at a lower frequency, it simply picks every Nth sample to achieve this. So you will often get better signal quality if you sample at the internal frequency and then downsample in software.> As for echo cancellation, it will be less complex (and as good) on a > (cleanly) down-sampled signal (and certainly not on stereo).That's good to know. Thanks :)