Subject: Re: Apple IIGS sounds -> Macintosh From: supertimer@aol.com (Supertimer) Date: Fri, Jun 26, 1998 419) EDT Message-id: <1998062608194300.EAA02761@ladder03.news.aol.com> spec@vax2.concordia.ca (Mitchell Spector) wrote: >In article supertimer@aol.com (Supertimer) writes... > >>The low pass filter enhances the sound, not degrades it. Henrik >>Gudat admitted as much after I emailed him the following. ;-) > > How can it enhance it if it doesn't allow output any greater >than roughly 26 kHz to output the GS? Even comparing 8-bit sound >samples, there is a noticable difference between 26 and 44 kHz. Umm...Mitchell, you are confusing "sampling rate" with "frequency" ...sampling theory is quite clear that any signal is recreated from discrete samples, there is no useful output above one-half the sampling frequency, the so-called Nyquist frequency. This is why the most sacred tenet of digital audio is the Nyquist Theorem - for a given sampling rate (such as 44Khz), there is no useful output above the Nyquist frequency (1/2 the sampling rate, in the case of most digital audio, that's 22Khz). Anything above this Nyquist frequncey is noise. Why is this? Sound is wavelike in nature. One Hz of frequency is one peak and one valley crossing the origin...a sin wave that can be represented like this... | _____ |/ \ |-------\-------/-- | \_____/ | ^ one cycle ^ Each Hz has TWO parts, one peak and one valley. To represent this digitally, you have to sample, or approximate. This is like looking at the wave through a picket fence. See, in terms of sampling rate, one Hz represents ONE thing, the pickets (or the spaces between the pickets). So imagine what happens when you try to sample a 44Khz sound at 44Khz? Like trying to see a wave with 44 thousand SETS of peaks and valleys through a picket fence with 44 thousand pickets? It won't work. You'll block out your signal, resulting in a zero value rather than an approximation of your original sin wave. Like this... . . . . . . . . |.|.|.|.|.|.|.|.|.| | | | | | | | | | | | | | | | | | | | | | | | | | | | or | | | | | | | | | or |.|.|.|.|.|.|.| Where the pickets block out your part of each cycle. The best you can do with 44Khz sampling is capture a maximum frequency 1/2 that of your sampling rate. So with 44 pickets, you can at most see 22 thousand cycles of your wave like this... . . . . . | | | | | | | | | | | |.| |.| |.| |.| | If energy above the Nyquist frequency is not filtered out, it will only increase the noise in the re-created waveform. Why? Because the frequencies above the Nyquist frequency can't be sampled accurately, the reproduced sounds in that range are necessarily noise. This happens with light, which is also wavelike in nature, if you try to pass it through too small a slit and in the case of light it is called diffraction. When you pass your light through too small a slit, the light waves interfere with each other to create gaps in an image when the light is focused onto a screen. This is why in a camera, you can stop down (close) the aperature (the opening) to increase your depth of field (area in focus) up to a certain point before diffraction hits and your image quality begins to degrade. Light of higher frequencies (blue) are affected before light of lower frequencies (red). Like diffraction effects in a camera or microscope, the noise above the Nyquist frequency is going to degrade the sound. Unless you add the low pass filter. The low pass filter will cut out those excess harmonics above 22 Khz, transforming the square wave output from the DAC into a (relatively) smooth sine curve. Even if you don't have the low-pass filter, putting that signal into an audio amp and a speaker is definitely going to cut out those high frequencies. The low pass filter simply makes for the most accurate waveform on a 'scope. It does very little to the audible quality of the sample. However, all well designed digital audio equipment will have a low pass filter. The bottom line is this: in digital sampling and playback, any output frequency above 1/2 the sampling rate is distortion and needs to be filtered out for the most accurate result. In this example, the sampling rate was 44 Khz and any frequencies above 22 Khz are extraneous, introduced by the digital sampling process. Think about it this way -- the GS and the PC both runs a sampling rate of 44 KHz. The only useful frequencies when sampling 44 KHz are 22 KHz and below. The frequencies above this are distortion. The GS passes the raw waveform through a low pass filter to smooth out the waveform. This is the same process that happens in many digital audio equipment such as CD players. If the PC does not have a low pass filter at 26 KHz, you are simply going to get more distortion than the GS output. If the PC's output goes through an amp and speaker, you lose those high unusable frequencies even without a low pass filter. There is no difference and if there was, the GS sound would be cleaner. Why would Apple put a low pass filter in the GS on purpose if it was detrimental. Why does my CD player have such a low pass fileter if it is so bad? To summarize -- your Wintel can do 44 Khz SAMPLING RATE and so can the GS. 44 Khz SAMPLING RATE equates to 22 Khz FREQUENCY. That falls UNDER the low pass filter of the GS. The filter is just removing distortion... > How can it enhance it if it doesn't allow output any greater >than roughly 26 kHz to output the GS? Even comparing 8-bit sound >samples, there is a noticable difference between 26 and 44 kHz. Your last sentence, "there is a noticable difference between 26 and 44Khz" do you see your error? You are using 26Khz from the GS, which is FREQUENCY and comparing it to 44Khz from your Wintel which is SAMPLING RATE. They are two separate things. When your Wintel or a CD player SAMPLES at 44Khz, the objective is to capture a maximum FREQUENCY of 22Khz...FREQUENCY is SOUND ...what you HEAR. You don't HEAR the 44Khz sampling rate. You HEAR 22Khz, which is the REAL SOUND. The low pass filter does NOT cut sampling rate, it cuts FREQUENCY (ie. NOISE) above the Nyquist frequency. Look at this another way...when you play a 44Khz sample on the GS, the low pass filter deprives the sample of no useful info (just like the low pass filters on CD players or DVDs or LDs don't degrade anything) because the maximum useful FREQUENCY that's captured is 22Khz...which is below the low pass filter. > Also, why is it synthLAB and Soundsmith sequences sound much >crisper and sharper when output through my PC (using XGS or MTP) >compared with the same sequences played on a real Apple IIgs? I use XGS with an cheap AD1815 sound card and I don't hear the difference you describe. If there is any difference in your case, it is probably due to the difference in quality of sound produced by the oscillators in the Ensoniq chip. I talked to a user of the ESQ-1 once and he said he could know if music was played on an ESQ-1 right away because of the "Ensoniq whine" (his words). Try passing the GS output through a graphic equalizer and notching up the frequencies at 11-16Khz...see, it has nothing to do with frequencies anywhere NEAR 26Khz...it is the response characteristics of the chip. For a more complete explanation, here are several old posts that go into the subject at length...and Mitchell, do a web search for "Nyquist" if you don't believe csa2 readers (looks like all these people replied to you, but you ignored them all ;-) >>> Subject: Re: Q: Applied Engineering Sound Card From: mjmahon@aol.com (MJMahon) Date: 1997/03/29 Message-ID: <19970329074700.CAA26305@ladder01.news.aol.com> Newsgroups: comp.sys.apple2 [More Headers] [Subscribe to comp.sys.apple2] Mitchell Spector (spec@vax2.concordia.ca) wrote: >>>The final blow to the chip was the low-pass cut-off filter that the >>>GS added. Apparently, from what I'm just finding out now, regardless >>>of whether the chip or software played a sample at 44.1 kHz (or other >>>high frequencies) the filter would essentially drop the quality down >>>to around 26 kHz. >> >>Mitchell, could you post the passage from this article? From what >>I've read, the GS does not have such a filter, but the Amiga >>does. The author of the article that I read said that the Amiga's >>sound can sometimes be cleaner because it has a low-pass cut-off >>filter that filters out the ultrasonic frequencies. He said that >>the GS lacked such a feature. > > The Ensoniq has no low-pass filter, but there _is_ one on the IIgs >motherboard (everything coming out of the chip has to go through it). >This lowers the quality of the Ensoniq when your playing higher >frequency sound (roughly anything above 26 kHz). I have heard that >the Amiga 1000 had a low-pass filter as well, but you could modify >the board to by-pass it (I think the Amiga 500/2000 also had one, >but you could disable it through software?). > > Article? Well I do have an e-mail message from David Empson who >was explaining the technical details behind the low-pass filter, but >I don't want to post it without his permission. It certainly does >exist though, I've found references to the low-pass filter in some >Addison Wesley books and it should be covered in the Apple II technotes. >It definitely is not an advantage to have one. :/ Wrong. Sampling theory is quite clear on this point. When any signal is recreated from discrete samples, there is no useful output above one-half the sampling frequency, the so-called Nyquist frequency. If energy above the Nyquist frequency is not filtered out, it will only increase the noise in the re-created waveform. Think of it this way: the unfiltered output is a stairstep approximation to the sound being produced, while the desired sound is a continuous waveform (with maximum frequency not exceeding Sampling Freq./2). The same filtering must be applied prior to sampling an input waveform, since any energy above the Nyquist frequency would simply be "folded back" (aliased) into the frequency range from 0 to Nyquist freq. Since "brick wall" lowpass filters are hard to make and have undesirable phase-shift characteristics near the cutoff frequency, gentler lowpass filters are used, which will be 3db down somewhat before the Nyquist frequency, so that they can be >30db down at the Nyquist frequency (and beyond). Note that much lower lowpass cutoffs should be used when sampling at lower frequencies. For example, if sampling at 11KHz, then the lowpass should cutoff lower than 5.5KHz, the Nyquist frequency. There ain't no such thing as a free lunch--and you can't do better than the Nyquist frequency! A lowpass simply acknowledges reality and makes for a proper design. -michael Email: mjmahon@aol.com Home page: http://members.aol.com/MJMahon/ Subject: Why we have low pass filters, the Nyquist theorem (was Re: Expand ing Focus Capacity) From: pubpc1@library.ucla.edu Date: 1998/03/06 Message-ID: <35002850.4B6A@library.ucla.edu> Newsgroups: comp.sys.apple2 [More Headers] [Subscribe to comp.sys.apple2] Mitchell Spector wrote, in response to my reply: >>You must have not been paying attention, I'm saying it does >>not matter. According to theory, you can capture a maximum >>frequency of 1/2 the sampling rate. That means that even >>though a CD player is sampling at 44kHz, the maximum signal >>frequency it can carry is 22kHz. What's above 22kHz is >>NOISE. That 26kHz low pass filter is only filtering out >>NOISE. You have to playback at 52kHz (double the 26kHz low >>pass filter) for the filter to have the effect you are >>thinking about. > > So now there is no such thing is WYSIWYG, and there is >no difference between 22 kHz and 44 kHz. Uhuh. The way I >see things, your trying to make excuses about the graphic >and sound limitations of the GS so you can still compare >it favoribly to modern computers. Mitchell, you have not been paying attention. I am just about to pull a Nathan Mates here! Have you ever heard of the Nyquist theorem? You haven't, have you? Point your web browser to: http://www.opus1.com/~violist/help/nyquist.html and read that carefully. Digest the information, now. Do you see the explanation about the low pass filter. Once again, here are the highlights of the Nyquist theorem and why we have low pass filters: The Nyquist Theorem: ---------------------------------------------------------------- What about the high end? The sampling frequency determines the limit of audio frequencies that can be reproduced digitally. One of the most important rules of sampling is called the Nyquist Theorem, which states that the highest frequency which can be accurately represented is one-half of the sampling rate. So, if we want a full 20 kHz audio bandwidth, we must sample at least twice that fast, i.e. over 40 kHz. If we don't, bad things happen. Here's our example sine wave again: (see web page for graphic) ---------------------------------------------------------------- Why we have low pass filters: ---------------------------------------------------------------- (graphic of a mangled sine wave) Because of this, A/D converters must use lowpass filtering to remove all signals above the Nyquist frequency. Of course, it also means that in order to get high-fidelity sound, we have to take a lot of snapshots. ---------------------------------------------------------------- Quick, Mitchell, what is the proper design of an A/D converter? Answer: "a low pass filter must be used to remove all signals above the Nyquist frequency." When a CD player samples at 44kHz, the objective is to capture 22kHz frequencies. What is above 22kHz is NOISE. CD players also have low pass filters that chop off the NOISE above the Nyquist frequency. I _strongly_ suspect that if the designers of PC sound cards have any brains at all, most PC sound cards would also have low pass filtering. Sure, it may be more advanced than that of the GS (I can imagine that their low pass filtering would sweep at 6kHz for 11kHz samples and 24kHz for 44kHz samples), but it is PROPER DESIGN to have one. Otherwise, you get NOISE. >>First, sample a sound on your PC at 44kHz and 16 bit. >>Then sample the same sound at 44kHz and 8 bit. Can you >>hear a difference? Probably, but it is subtle. Take >>the 44kHz 8 bit sound to the GS and play it. There is >>absolutely no difference in quality between this playback >>and the playback of the PC (the 44kHz 8 bit one, that is). > > So essential your trying to tell me sound or music recorded >at 16-bit, 44 kHz--and the same sound recorded at 8-bit, 22 kHz, >will sound more or less identical in quality? No. I am saying there is a subtle difference between 16-bit, 44kHz sound and 8-bit _44kHz_ sound. Those kHz are the SAMPLING RATE! Maximum frequency captured is _1/2_ the sampling rate. When your PC sound cards are sampling at 44kHz, only 22kHz of that is the maximum frequency capture. What is above that is NOISE. Most likely, your Roland is doing the right thing and taking out the noise above the NYQUIST FREQUENCY of 22kHz (or a little above that) with A LOW PASS FILTER. When you take the 8-bit 44kHz SAMPLE to the GS, the Ensoniq plays it as an 8-bit 44kHz SAMPLE. Maximum frequency captured is _1/2_ the sampling rate. What is above that is NOISE. The sound gets CLEANED UP through the low pass filter. You lose nothing compared to what you get when playing the same sound through the PC. Apple Computers may have done many things to hold back the GS, but the low pass filter was NOT one of them. > Are you also saying the GS is closely comparable to a CD-player >for audio, is this what your claiming? If you are, then this debate >is starting is shift from a technical discussion to a comedic one. No. However, the sound coming from a GS is quite good. CD players have low pass filters, btw. I've worked out a system to get clean, long samples to the GS. Digitize on a Mac or PC at 8-bit 44kHz. Save and transfer on a Zip drive, hard drive, or null-modem over to an HFS volume on the GS (if using Zip drive with PC disk, use MUG!). Use Longplay or Oversampler to play the sample. There's no loss in quality compared to playing the same sample on the PC. The low pass filter is a good thing. -Scott G. Subject: Re: Q: Applied Engineering Sound Card From: Eric Jacobs Date: 1997/03/30 Message-ID: <333EFE15.7B81@no.no> Newsgroups: comp.sys.apple2 [More Headers] [Subscribe to comp.sys.apple2] MJMahon wrote: > > There ain't no such thing as a free lunch--and you can't do better > than the Nyquist frequency! A lowpass simply acknowledges > reality and makes for a proper design. > > -michael > > Email: mjmahon@aol.com > Home page: http://members.aol.com/MJMahon/ Well said. And it might also be worthy to note that even if you don't have the low-pass filter, putting that signal into an audio amp and a speaker is definitely going to cut out those high frequencies. The low pass filter simply makes for the most accurate waveform on a 'scope. It does very little to the audible quality of the sample. I think much of this confusion results from the ambiguity of kHz, which can either refer to "thousands of samples per second" (sampling rate) or "thousands of cycles per second" (which is frequency.) You can't sample a 22 kHz frequency, at 22 thousand samples per second. You're asking to represent this: | _____ |/ \ |-------\-------/-- | \_____/ | ^ one cycle ^ in one digital sample! It doesn't make sense to put a whole cycle of anything into one digital number, whether it's an 8-bit or a 16-bit. You'll just get zero. You'll have more success if you try to sample that frequency at 44 kHz. Then you'll get two samples per cycle. This will at least give -some- variation in the sample. You'll get +1,-1,+1,-1,+1,-1,.. etc. This is of course, a square wave, which is a very poor approximation for the sine wave it is intended to represent. Unless you add the low pass filter. The low pass filter will cut out those excess harmonics above 22 kHz, transforming the square wave output from the DAC into a (relatively) smooth sine curve. The bottom line is this: in digital sampling and playback, any output frequency above 1/2 the sampling rate is distortion and needs to be filtered out for the most accurate result. In this example, the sampling rate was 44 kHz and any frequencies above 22 kHz are extraneous, introduced by the digital sampling process. Even the 26 kHz low pass filter in the GS may be bit excessive. Humans can't hear anything above about 20 kHz or so. The whine you sometimes hear from TV's scan circuitry is 15.7 kHz. Most of the useful audio we hear is way, way below that. So the 26 kHz low pass filter on the GS motherboard wasn't put there to lower the sound quality. It's merely part of proper digital sound design. Other computers can get away without the filter because they expect the audio will be fed into an audio amp or mixer, which will cut off the high frequencies anyway. Or maybe they were just engineered by aliens from outer space who have exceptionally high frequency vocal cords. :) As a human, I find the GS serves me well. As for those OTHER machines, .. well.. -ej <<<