Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: About oversampling and lowpass theory (Read 9113 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

About oversampling and lowpass theory

Greetings,

I'm currently on a DSP course in my university and I would like to ask the technical experts here about some DSP-related (theoretical) issues.

It is widely known that in CD-audio the frequency band between 20-22 kHz is quite unusable, consisting mostly of aliased and highly attenuated remains of signals.

But isn't this the case only if the signal is originally recorded at 44.1 kHz, meaning that an analog lowpass filter (i.e. 8-point Chebychev) has to take place and filter out (or at least attenuate adequately) everything above 22.05 kHz leaving the 20-22 kHz band useless as I stated?

So what if the signal would have been recorded at say 96 kHz in the first place, with an analog lowpass stop-band of at say 92-96 kHz. In this case, the resulting 96 kHz signal could be digitally lowpassed (much narrower stop-band) at 22.05 kHz and decimated with a factor of 0.5 leaving us with full, usable 22.05 kHz frequency band.

What I'm trying to ask here is that with oversampling techniques couldn't we get CD-audio where the highest (20-22 kHz) frequency band wouldn't be unusable garbage?

Well, since so few people can hear high frequencies and CD players lowpass everything over 20 kHz anyway that it wouldn't make much difference. But as I stated, this is a theoretical question

Edit:

I had to put this to "Off-topic" section since this is a DSP related but isn't codec-specific technical issue...

About oversampling and lowpass theory

Reply #1
From what I understand, a low order low pass filter has to be used to prevent phase distortion. As we know, the low order lpf has a gentle cutoff slope, so attentuation has to begin at a frequency somewhat lower to get full attenuation at 22.1kHz, and I guess this frequency starts at 20kHz

 

About oversampling and lowpass theory

Reply #2
Quote
Originally posted by niktheblak So what if the signal would have been recorded at say 96 kHz in the first place, with an analog lowpass stop-band of at say 92-96 kHz. In this case, the resulting 96 kHz signal could be digitally lowpassed (much narrower stop-band) at 22.05 kHz and decimated with a factor of 0.5 leaving us with full, usable 22.05 kHz frequency band.

I believe you mean 88.2kHz sampling rate and not 96kHz since you want a 0.5 decimation. Well, this wouldn't work because you will still suffer from aliasing images. All the signals in the 22.05kHz to 44.1kHz range will be reproduced as signals in the 22.05kHz to 0kHz range. That's a lot of audible noise.

When sampling or resampling, you absolutely need to lpf beforehand at half the new sampling rate to prevent these images.

About oversampling and lowpass theory

Reply #3
I don't agree with the opinions written here.

Almost all ADCs (and DACs) use oversampling, which means that the digital signal is sampled at many times the target sample rate, and the majority of the anti alias filtering is carried out in the digital domain, before decimating the signal (removing every n-th sample) to get to the sample rate you require (in this case, 44.1kHz).

The quality of the digital anti-alias filter isn't always optimal (because a more accurate frequency domain response requires more filter taps, which requires more processing power. Also, the better the frequency domain response, the longer the time domain ringing of the filter). However, some systems contain fantastic filters, which get you almost all the way up to 22kHz without any aliasing problems. It is possible to generate a filter which passes 22kHz perfectly, and attenuates 22.05kHz by 120dB - you can even do it in Cool Edit Pro!

So, the idea of an ADC or DAC running at natively 44.1kHz is nearly 20 years out of date - all current models oversample, and perform the anti-aliasing at the higher (oversampled) rate. Unfortunately, the anti-alias digital filters aren't always great because of cost constraints, but they can be very good, giving almost textbook response up to 22kHz. The phase response can be perfectly linear, though again, cost contraints can compromise this.


Even in a non-perfect world with poorly designed convertors, there is no reason to say that everything above 20kHz is noise but everything below it is pure signal. The poorer the filter design, the worse the aliasing - it won't necesarily stop at 20kHz. This idea of a magical 20-22kHz band filled with aliasing is false. Things could be much worse, or much better. Whilst the CD specs suggest that things should be EXACTLY like that (0-20kHz signal, 20-22kHz noise), this doesn't happen in practice.


Removing everything above 20kHz on playback isn't such a bad idea. If it's signal, then you probably can't hear it anyway (well, I can't - some of you are younger, or looked after your hearing better). If it's alias components, then removing it can prevent some intermodulation within the speakers which will give rise to audible noise. If there's nothing there at all (this is quite rare!) then there's still no harm in removing it.

But to assume that there's never anything useful up there would be false. If you record at 88.2kHz and resample optimally, you can be sure that what's up there is accurate.


You can play around with this stuff in Cool Edit. Generate a test signal at 88.2kHz, resample it down to 44.1kHz, and then resample it back up to 88.2kHz (to simulate the action of an oversampling DAC). See what frequencies remain, and which ones are swamped by Alising distortion. You might be surprised.

Cheers,
David.
http://www.David.Robinson.org/

About oversampling and lowpass theory

Reply #4
I moved this informative thread to the general forum. Too informative for the Off-Topic forum (this thread is general information about audio so it goes perfectly to the general forum), and OT- forum threads are anyway invisible at the front page latest discussions window.
Juha Laaksonheimo

About oversampling and lowpass theory

Reply #5
First, thank you all for informative, well-written answers. As my studies go on and with your kind answers I now know a little more about CD-systems and DSP in general


Quote
Originally posted by 2Bdecided
I don't agree with the opinions written here.

Almost all ADCs (and DACs) use oversampling, which means that the digital signal is sampled at many times the target sample 


Yes, I found out this after writing my initial post. Multirate DSP is very common in general.

Quote
domain ringing of the filter). However, some systems contain fantastic filters, which get you almost all the way up to 22kHz without any aliasing problems. It is possible to generate a filter which passes 22kHz perfectly, and attenuates 22.05kHz by 120dB - you can even do it in Cool Edit Pro!


And the best part is that mathematical models of these filters are very easy to construct. For example, windowed sinc and Remez-method spit out superior filter kernels just as fast as you can tweak them. And the best of all, they all have perfectly linear phase response in passband.

Basically zero ripple at passband, 5 Hz transition band and 120 dB attenuation at stop band are not impossible to attain. And if we aren't looking for this extreme filters, an adequate compromise between time-domain ringing and frequency response can be found. I have experimented a little with double Hamming sinc in matlab with exciting results.

However, this is "classic" DSP filtering in question and thus the way I would do it. I don't know if audio compressors convolve the signal with a filter kernel in order to lowpass or are more sophisticated methods used. If someone has time to elaborate or provide address to technical documentation, I would be very grateful. And don't afraid to be technical


Quote
Unfortunately, the anti-alias digital filters aren't always great because of cost constraints, but they can be very good, giving almost textbook response up to 22kHz. The phase response can be perfectly linear, though again, cost contraints can compromise this.


Yes, unfortunately filtering by convolution (even FFT convolution) is mostly reserved for efficient processors.

Quote
But to assume that there's never anything useful up there would be false. If you record at 88.2kHz and resample optimally, you can be sure that what's up there is accurate.


And this answers my initial question. Theoretically it shouldn't be a problem.

Thank you!

Edit:

For my main source of information (plus lecture material of course) I use and sometimes directly quote Stephen W. Smiths The Scientists And Engineer's Guide To Digital Signal Processing. The 500-page book is downloadable in PDF format from

http://www.dspguide.com

For anyone interested in learning DSP I would recommend reading this book. It's very well written, informative and free to download.