Audio cut-off really at 1.6kHz?

Modding and Technical Issues

Moderator: Moderators

User avatar
pixel
Vic 20 Scientist
Posts: 1359
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Audio cut-off really at 1.6kHz?

Post by pixel »

Is this really the case? Because I thought I'd have heard higher frequencies and that's really not the kind of bandwidth where one can understand digitised speech, or can one?
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: Audio cut-off really at 1.6kHz?

Post by Noizer »

In my ears it’s not an absolute cut off, the high and middle frequencies are there. Try to connect some audio equipment to rise the highs. I think therefore no need for modifications on the sacred motherboard
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
User avatar
Mike
Herr VC
Posts: 4842
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Audio cut-off really at 1.6kHz?

Post by Mike »

The cut-off frequency of a low-pass filter is defined as the frequency, where the attenuation is at 3 dB, i.e. 70% of the maximum signal amplitude. To a first approximation, you have 100% of the signal below cut-off, and then the attenuation increases with 20 dB per decade.

In the VIC-20 audio circuitry, two RC filters define one cut-off frequency at 1.6 kHz (as you wrote) and another at 16 kHz. Between 1.6 kHz and 16 kHz, the attenuation increases with 20 dB/decade, above that with 40 dB/decade.

So, in principle you can still output a, say, 20 kHz sine wave - but it will be very quiet.
User avatar
pixel
Vic 20 Scientist
Posts: 1359
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Audio cut-off really at 1.6kHz?

Post by pixel »

Noizer wrote: Fri Sep 04, 2020 12:32 am In my ears it’s not an absolute cut off, the high and middle frequencies are there. Try to connect some audio equipment to rise the highs. I think therefore no need for modifications on the sacred motherboard
Just would love to know what's going on really. Could help others to improve VICE and me to think up better audio code.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1359
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Audio cut-off really at 1.6kHz?

Post by pixel »

Mike wrote: Fri Sep 04, 2020 1:27 am The cut-off frequency of a low-pass filter is defined as the frequency, where the attenuation is at 3 dB, i.e. 70% of the maximum signal amplitude. To a first approximation, you have 100% of the signal below cut-off, and then the attenuation increases with 20 dB per decade.

In the VIC-20 audio circuitry, two RC filters define one cut-off frequency at 1.6 kHz (as you wrote) and another at 16 kHz. Between 1.6 kHz and 16 kHz, the attenuation increases with 20 dB/decade, above that with 40 dB/decade.

So, in principle you can still output a, say, 20 kHz sine wave - but it will be very quiet.
So I guess Fourier transform it is? Cannot see the standard LPF algorithm do such thing.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
Mike
Herr VC
Posts: 4842
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Audio cut-off really at 1.6kHz?

Post by Mike »

pixel wrote:So I guess Fourier transform it is? Cannot see the standard LPF algorithm do such thing.
It's perfectly possible to do frequency filtering in the time domain.

Simple example: y(i) = 0.1 * y(i-1) + 0.9 * x(i), with x(i): input and y(i): output. The cut-off frequency depends on the sample rate and the coefficients.

Keywords: IIR filter, step-invariant Z-transform. ;)
User avatar
pixel
Vic 20 Scientist
Posts: 1359
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Audio cut-off really at 1.6kHz?

Post by pixel »

Mike wrote: Fri Sep 04, 2020 1:37 am
pixel wrote:So I guess Fourier transform it is? Cannot see the standard LPF algorithm do such thing.
It's perfectly possible to do frequency filtering in the time domain.

Simple example: y(i) = 0.1 * y(i-1) + 0.9 * x(i), with x(i): input and y(i): output. The cut-off frequency depends on the sample rate and the coefficients.

Keywords: IIR filter, step-invariant Z-transform. ;)
Yeah. Right. My math teacher probably just died by laughing too hard...
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1359
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Audio cut-off really at 1.6kHz?

Post by pixel »

Someone patched the low-pass filter in VICE and will probably commit it to the repository, soon. :) What remains is the terrible aliasing noise – but the same guy is interested in adding a resampler to get around it.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
groepaz
Vic 20 Scientist
Posts: 1189
Joined: Wed Aug 25, 2010 5:30 pm

Re: Audio cut-off really at 1.6kHz?

Post by groepaz »

That someone was Leandro, who is also the main driving force behind reSID fixing these days :)

The patch is merged now, have fun
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: Audio cut-off really at 1.6kHz?

Post by Noizer »

pixel wrote: Fri Sep 04, 2020 1:30 am
Noizer wrote: Fri Sep 04, 2020 12:32 am In my ears it’s not an absolute cut off...
Just would love to know what's going on really. Could help others to improve VICE and me to think up better audio code.
Mike is right, it‘s very possible the output samples > 16KHz with the standard vic20 hardware.
Therefore there is no need to cut off frequency above the 16KHz when preparing samples for feeding, as seeing on spectral view of Amen Brother. Of course, this rises the entropy of a sample, making eventually compression less efficient.
Bye for now
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: Audio cut-off really at 1.6kHz?

Post by Noizer »

Mike wrote: Fri Sep 04, 2020 1:37 am
pixel wrote:So I guess Fourier transform it is? Cannot see the standard LPF algorithm do such thing.
It's perfectly possible to do frequency filtering in the time domain.

Simple example: y(i) = 0.1 * y(i-1) + 0.9 * x(i), with x(i): input and y(i): output. The cut-off frequency depends on the sample rate and the coefficients.

Keywords: IIR filter, step-invariant Z-transform. ;)
Do you have some FFT (fast fourier tr.) algorithms for 65xx cpu available?
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
User avatar
pixel
Vic 20 Scientist
Posts: 1359
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Audio cut-off really at 1.6kHz?

Post by pixel »

Noizer wrote: Sat Sep 12, 2020 12:17 pm Do you have some FFT (fast fourier tr.) algorithms for 65xx cpu available?
Nah. Was thinking for VICE but it only needs a resampler now as the filter is emulated perfectly (I assume).
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
Mike
Herr VC
Posts: 4842
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Audio cut-off really at 1.6kHz?

Post by Mike »

The main issue is not with any filtering (or lack thereof) on the output side, i.e. when converting digital/sampled signals to analog output.

Main issue is the input side or when anything is resampled, keyword: Nyquist frequency. If there are any significant signal components at or above the Nyquist frequency (which is 1/2 the sampling frequency) in the input signal, they're folded/mirrored back into the baseband frequency range and produce alias frequencies. They're then what is heard as shrieking noise. Once they've been introduced, nothing can be done to eliminate them!

Now, the fun fact about Sigma-Delta modulation is: as long as you keep within the allowed dynamic range, its amplitude response is flat (i.e. = 1, or 0 dB attenuation) up to the Nyquist frequency and it merely inherits the characteristic of any filter attached to its output - see:

H. Inose, Y. Yasuda, J. Murakami, "A Telemetering System by Code Manipulation - ΔΣ Modulation" , Ire Trans on Space Electronics and Telemetry, Sep. 1962, pp. 204-209
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: Audio cut-off really at 1.6kHz?

Post by Noizer »

All perhaps interesting stuff. I thought instead something more in direction of Digital information solution or algorithms
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
User avatar
Mike
Herr VC
Posts: 4842
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Audio cut-off really at 1.6kHz?

Post by Mike »

Noizer wrote:All perhaps interesting stuff. [...]
We are talking about the basics of signal processing here. You would better get them right before throwing anything like a FFT against a rather simple problem like low-pass filtering audio signals.
Post Reply