Moderators: Dave Moll, Andrew Davie, Steve Anderson
Klaas Robers wrote:The point is indeed that Audacity sees the files of samples as sound. By down sampling from e.g 48 kHz to 16 kHz all spectrum (tones) from 8 kHz to 24 kHz that are present in the 48 kHz wave file, have to be removed BEFORE you can do the down sampling. Otherwise the might give unexpected and false notes in the spectrum below 8 kHz.
This low pass filter with a cut off frequency of 8 kHz is doing nothing for tones of 0 to 8 kHz and should suppress all tones above 8 kHz. Such a sharp filter inhearently introduces ringing on steep edges in the signal. We can't HEAR that ringing, as to our ears this is a natural process.
The way that you suggest, by averaging will not suppress frequencies above 8 kHz, do the process on a file of one pixel black, one pixel white, etc. This 24 kHz still gives modulation in the down sampled file. This effect is called "Aliassing".
Andrew Davie wrote:Thanks for the explanation. This is bothering me. If I consider the WAV file as a series of pixels, and do an image-processing resample on those pixels, then I will not get any artefacting like this, surely? It seems that the "Gibb's artefacts" are because of the assumption that we have a sound file and pixels are represented by an (infinite) sum of sine waves. That I understand. But I could, for example, write a simple program to resample 120 pixel scanlines (48KHz) to 48 pixel scanlines (19.2KHz). Then I wouldn't have any issues with "square wave discontinuities" because in fact each pixel is not a sum of sine waves, or an approximation - it's an exact value from 0-255. A resampled pixel is representing the averaged brightness of whatever span of pixels were being processed. There would be no "ripple", I think? Each pixel would be the average of the spanning 2.5 pixels (120/48). I can't see how a sharp discontinuity like the framing division would introduce sine-wave based artefacts in other pixels. A black band would simply dim the pixels adjacent. This, if processing as an image.
Andrew Davie wrote:because in fact each pixel is not a sum of sine waves, or an approximation - it's an exact value from 0-255.
No, it doesn't matter what the data is, sound, video, population statistics, telemetry, it is all the same, if the data can be represented as a function, it can be represented by sums simpler trigonometric functions - this is called Fourier Analysis and is fundamental to any type of signal processing.
ppppenguin wrote:Gary raises several interesting points.
Taking the last one first, I really don't think that sampling theory can be equated with Heisenberg's uncertainty principle. Sampling theory, Fourier, Nyquist etc all emerge naturally from the maths while the uncertainty principle is related to measurement and the presence of an observer. Leads us into difficult metaphysics very quickly.
No, it doesn't matter what the data is, sound, video, population statistics, telemetry, it is all the same, if the data can be represented as a function, it can be represented by sums simpler trigonometric functions - this is called Fourier Analysis and is fundamental to any type of signal processing.
ppppenguin wrote:I think there are some functions that don't work properly with Fourier analysis. My maths isn't good enough to demonstrate this but I think that artificial sequences such as infinitely sharp transitions from white to black can fool the system. And give horrible ringing if you try to filter them other than gently.
ppppenguin wrote:Quantising (number of bits) is a completely separate argument to sampling.
ppppenguin wrote: Fourier analysis doesn't involve quantising. If you don't have enough bits then you'll get additional errors above any caused by aliasing but that's not a problem in any well designed system. By proper application of dither any quantising errors can be turned into noise, thus avoiding the posterisation and banding effects you sometimes see. If you don't have enough bits in a filter calculation you can sometimes get overflow or underflow which will cause unexpected additional errors. The output of a filter can always be rounded to any desired number of bits. If done correctly this gives the usual tradeoff between number of bits and noise.
ppppenguin wrote:As an aside I once experimented with 1 bit video. Looked evil on monochrome pictures but PAL colour subcarrier was an effective dither signal so coloured parts of the picture looked much better.
gary wrote:Andrew, do you mind sharing the audio file of your "really good looking" Dr Who video please?
Andrew Davie wrote:gary wrote:Andrew, do you mind sharing the audio file of your "really good looking" Dr Who video please?
Not at all! Be warned - 100MiBi download! Doctor Who audio file
You might need to right-click "save as" if your browser tries to actually play it
Oh yes, don't forget it's in my NBTV8 format!
That's 8-bit video and audio, with video unsigned 8-bit, NO synch pulses. 19200 Hz. Audio signed 8-bit.
12.5fps, 48 pixels high, 32 scanlines. Video left channel, I seem to recall.
Return to Andrew Davie's Arduino Televisor
Users browsing this forum: No registered users and 8 guests