nesdev.comhttps://forums.nesdev.com/ what is the cut off freq of the nes ?https://forums.nesdev.com/viewtopic.php?f=3&t=4946 Page 1 of 2

 Author: mattmatteh [ Thu Mar 12, 2009 6:50 pm ] Post subject: what is the cut off freq of the nes ? is the cut off frequency for the high pass and low pass of the nes known ? if so, is the gain or frequency response known ? i am familiar with digital signal processing from school, had an intro to it, but have not looked at it in a while. i am still working on getting sound working in my emu. i know blargg wrote blip but wanted to see how much i could do on my own to learn. might infact do what that does, but would like to learn it :) matt

 Author: lidnariq [ Thu Mar 12, 2009 7:47 pm ] Post subject: http://nesdev.com/NESAudio.gif Although we have to model it in discrete time in our computers, the NES generates the audio at ~1.8MHz and goes through a mostly-but-not-completely linear output stage as you can see in that image.

 Author: mattmatteh [ Thu Mar 12, 2009 8:14 pm ] Post subject: i have seen that. i guess i wasnt sure what exactly come out of pin1 and pin2. i didnt know if anyone had the numbers. my electronics skills are not that good and not sure i would be able to determine the cut frequencies of that or the gains. i know there is a non linear mixing equation on the wiki and other sound docs, i assume that includes the internal and external mixing on the nes. thanks matt

 Author: kyuusaku [ Thu Mar 12, 2009 11:04 pm ] Post subject: I see a bunch of low pass filters, there's: -one made by the 220pF cap before the inverting amp and the audio output Z -same cap making a low pass filter with the interting amp's feedback resistor (47K & 220pF) -capacitor feedback on the inverting amp making an integrator/active LPF? -one made by the series inductor and the following cap (39uH & .01uF) -one made on the output (150R & 47pF)

 Author: blargg [ Fri Mar 13, 2009 7:01 am ] Post subject: The raw internal output from the 2A03 on the two pins is very likely unfiltered. The non-linear mixing doesn't do any filtering either. So it's all after that, as kyuusaku detailed above.

 Author: tepples [ Fri Mar 13, 2009 7:26 am ] Post subject: I've made recordings of 1 kHz square waves and noise played through the NTSC frontloader's RCA audio jack, if those help any.

 Author: blargg [ Fri Mar 13, 2009 8:52 am ] Post subject: The problem is that this also includes your sampler's low-pass (and high-pass) filtering. Making recordings of the raw 2A03 output pins AND the RCA output would allow them to be compared to find out the filtering done, though I never could figure out how to quantify it well. I think one uses an impulse to determine this, i.e. a pulse as short as possible, that still results in significant amplitude. An impulse contains all frequencies of equal amplitude, so running it through a spectrum analyzer (Fourier Transform) shows any filtering that was done to it, as well as any phase shifts.

 Author: mattmatteh [ Fri Mar 13, 2009 11:20 am ] Post subject: is there a high pass filter in there too ? right now i am dumping audio to a file and looking at it in audacity. its unfiltered at the moment and have been filtering in audacity. i was just wondering what the low and high frequency is, and rolloff.

 Author: tepples [ Fri Mar 13, 2009 11:41 am ] Post subject: mattmatteh wrote:is there a high pass filter in there too ? I'm pretty sure the NES has a high-pass filter of some sort on its RCA audio output. I saw a high-pass characteristic in the recordings I mentioned, and it's probably not entirely the PC because the sound card (an SB Ensoniq AudioPCI) has picked up rumble as low as 5 Hz from my desk mic.

 Author: blargg [ Fri Mar 13, 2009 12:33 pm ] Post subject: The 1 uF capacitor just after the mixer and the 10 uF capacitor just before the audio output should do some high-pass filtering.

 Author: kyuusaku [ Fri Mar 13, 2009 1:10 pm ] Post subject: Perhaps instead of using the APU's output, it would be easier to lift the mixing resistors and use a computer's line out?

 Author: blargg [ Fri Mar 13, 2009 2:18 pm ] Post subject: Then you get the filtering the computer's line out has. I think the NES can generate good impulses with frequency content well above 20 kHz, we just need to be able to do something useful with the result. I had tried this a while back but never got anything useful. I think another issue is that the more into the PC's low-pass rolloff you go, the less you can determine the rolloff of the NES filter; when you reach the PC's cutoff, you obviously can't determine anything about the NES. Here's a recording of the raw output from the 2A03 (left channel), and the RCA (right channel):, with levels adjusted so the second wider pulses have the same initial delta nes_raw_rca.wav I don't have very good analysis tools, so perhaps someone else can compare the two to determine the filtering occurring between them, which would be what the NES output amplifier circuit does.

 Author: frantik [ Fri Mar 13, 2009 4:07 pm ] Post subject: blargg I can analyze the sound but it would be useful if the recordings of each type were a bit longer.. like a second or more of white noise coming from each output? also if you could record at a high sample rate it will show how high up the response goes I checked out tepples recordings and the white noise appears to be pretty flat all the way up and past 20kHz in the NES-001.ogg file (which i assume is an acutal nes)

 Author: blargg [ Sat Mar 14, 2009 9:42 am ] Post subject: I'm not sure I can get white noise. I do now see that an impulse isn't that great for determining high-pass, but for low-pass it's good; perhaps the step response will be best for determining high-pass. I re-recorded some that were in like phase (where the impulse falls relative to the sampler affects things). Black is the raw output from the 2A03 (and thus shows the low-pass of my PC's sampler), red is the RCA, and blue is with a one-pole filter with coefficient ~0.816 applied to the raw, which closely approximates the RCA. The frequency scale is linear from 0 to 22050 Hz (my sampler won't do any higher, sorry). The filter that seems to approximate low-pass characteristics is just out[i]=(in[i]-out[i-1])*0.815686. EDIT: And for high-pass, using out[i]=out[i-1]*k+in[i]-in[i-1] twice, with k=0.996039 and k=0.999835 seems to approximate it well (step response, red is NES RCA, blue is raw run through above filter): Perhaps someone can confirm that these two constants match the R-C high-pass filters in the schematic. EDIT: And of course the above iterative filter equations are run at a 44100 Hz sampling rate; other rates would use different coefficients.

 Author: lidnariq [ Sun Mar 15, 2009 10:30 am ] Post subject: blargg wrote:Perhaps someone can confirm that these two constants match the R-C high-pass filters in the schematic. The k=.999835 HP is a time constant of 1700us, and it corresponds to the very last output stage -- the 150ohm resistor and 10uF cap (corner freq=90Hz). The k=.996039 HP is a time constant of 360us, I haven't yet found what it corresponds to. (corner freq=442Hz) (edit: This might correspond to the 47k on the resistor through the inductor and the .011uF of capacitors, or the .011uF of capacitors and the 270ohm resistor after the BJT with its resistance amplified by the BJT (appx a factor of 200).) The k=.815686 LP is a time constant of 11us, the 47kohm and 220pF lowpass around the inverter-used-as-an-amplifier (corner freq=14kHz). (The time constant for the LC seems to be faaaaar above audible frequencies, time constant=654ns -> corner freq=243kHz)

 Page 1 of 2 All times are UTC - 7 hours Powered by phpBB® Forum Software © phpBB Grouphttp://www.phpbb.com/