I took this test earlier... Those frequencies are atrocious! 22k I couldn't hear, but 21 felt like there were tiny insects in my ears shredding my eardrums apart. Unbearable.
gyms: I'm using a library called blip-buffer to generate alias free waveforms, and it works very well when using as intended.
My idea was that it might also work for the N163 mixing model since it also operates as a low-pass filter which would remove the switching noise above the nyquist frequency, but I think that is pushing it a little as it's clear that some noise is leaking through (changing the sample rate proves that too). There are probably ways to improve it further that might be worth looking into. Although it is true that this is complicated, Nezplug++ deals with this by completely turning off the switching mode when using less than 8 channels
Nezplug++ deals with this by completely turning off the switching mode when using less than 8 channels
Would you consider making this sort of compromise for FamiTracker? It seems this would be the best option without going through the trouble of developing some new anti-aliasing method just for the problems unique to the N163.
Earlier I ran some things through a spectral analyzer out of curiosity, to see what was going on exactly. jsr, I'm sure you're already well aware of all this, but I'll go ahead and post what I found here for anyone else who's interested.
Description: These are comparisons of N163 waveforms as generated by the current beta(4) of FamiTracker. In order to best study the aliasing effects of the N163 switching-noise, I chose the 32-long sine wave sounding a C-0, the lowest note possible on the N163 in Famitracker. I have rendered this note under each possible N163 channel setup under two sample rates: 44.1kHz and 96kHz.
I'll give brief descriptions for those who might not be able to read what the data is showing. Note that the spectral analysis window changes its displayed bandwidth depending on the file's sample rate. It's important to compare data and not shapes.
Number-of-channels comparison @ 44.1kHz:
To start, one-channel produces no significant aliasing artifacts and is a good reference for how it should look and sound when using 5 channels or less. Since this is a sine(ish) wave, there should be no large spikes other than the one to the far left, the fundamental frequency.
8-channels: The 15kHz noise is introduced. There should be no large spikes present between the fundamental spike and the switch-noise spike. However, there are. This is the result of aliasing and produces extra tones, ringing noises, that should not be there and would not be present if this were the actual hardware. This concept applies to the remainder of these examples.
3-channels: The switch-noise starts to lose its influence on the audible spectrum, but there is still enough audible aliasing artifacts that can still be heard.
Number-of-channels comparison @ 96kHz: A massive improvement as far as the the audible ring-tones are concerned. There are still some present here and there, but this is a classic example of how higher sample rates combat aliasing artifacts. Note the width of the spectrum analyzer has expanded to show the new possible frequencies of 96kHz. You can see the resulting overtones of the switch-noise extending way past the audible range into supersonic territory.
So as you can see, and hear, this is a problem. The extra ringing tones would not be present and is not faithful to the hardware. And as jrlepage and EHII helped demonstrate, you can't hear anything past 22kHz. The switch-noise would not be audible past the 6-channel setting. Even if it were possible, there's practically no speaker available that's capable of producing frequencies that high, but the resulting alias-artifacts are still clearly heard.
Well, the N163 waveforms themselves are supposed to have their own aliasing, due to their internal playback samplerate (which itself is aliased again second time through the CPU/15*chans cycling rate), not to mention other harmonic distortion from quantization (these are only 4-bit samples, remember). There is no way to make a clean sine wave on an N163.
What I mean is, gyms, that using a C tone might not be a good test; because the frequency of that C waveform itself will be aliased as well by the switching; and that aliasing is desired behaviour. (Probably not that strong an effect; but it still muddies the water a little, because that particular aliasing should be kept.)
The aliasing we have here that is a problem is simply aliasing of of frequencies generated above the nyquist frequency of our own samplerate. The FTM I posted two pages back is as pure/harsh a demonstration of it as possible, all waveforms 0 except one channel playing 15, which generates the strongest possible harmonics of the switching frequency. I don't think there's too much need to analyze it here; jsr seems to have a handle on it.
Also, lots of audio speakers (cheap and expensive) are quite capable of producing ultrasonic frequencies (you can try this out on a dog). Some speakers are designed to filter them out, but usually our ears are the limiting factor there, or other intentional limiting factors in the audio producing hardware (e.g. using a 44kHz samplerate).
Would you consider making this sort of compromise for FamiTracker? It seems this would be the best option without going through the trouble of developing some new anti-aliasing method just for the problems unique to the N163.
Sure it would be a possible compromise to turn it off when using less than say 7 or 6 channels, but I can do some recordings from a real cart later that can be compared with your recordings here. I wouldn't be surprised if there are some audible distortion there too.
I started doing a bit of test listening with different sample rates and channel combinations, and the results aren't so predictable as 96k being an improvement across the board. I'll post my results later today.
Also, I think it'd be best to test the noise by playing the lowest (least audible) note? Otherwise the tones simply modulate.
I've had no idea what you've all been going on about for the last 7 pages.
_______________________
iGotno_scope wrote:
im going to continue making this crazy stuff then after a while my style will be so sick that you will be like damn suuun that shit is so sick i dont even get it. i will be like bro its ok.. you dont have to.
Well, the N163 waveforms themselves are supposed to have their own aliasing, due to their internal playback samplerate (which itself is aliased again second time through the CPU/15*chans cycling rate), not to mention other harmonic distortion from quantization (these are only 4-bit samples, remember). There is no way to make a clean sine wave on an N163.
Yea, I wasn't questioning that. The 1-channel sample @ 44.1 shows this(assuming that the switch-noise had absolutely no influence at that point, which seems it doesn't for this 1-channel example given the patterns of its influence). I'm assuming that the 1-channel sample I have here is an example of what the tone looks and sounds like, aliasing and all, completely untouched by the switch-noise artifacts.
rainwarrior wrote:
What I mean is, gyms, that using a C tone might not be a good test; because the frequency of that C itself will be aliased as well by the switching; and that aliasing is desired behaviour. (Probably not that strong an effect; but it still muddies the water a little, because that particular aliasing should be kept.)
My thinking in choosing that was to get the fundamental as far away from the switch-noise as possible, to establish home position of sorts and see how the switch-noise caused this pattern to distort.
rainwarrior wrote:
The aliasing we have here that is a problem is simply aliasing of of frequencies generated above the nyquist frequency of our own samplerate. The FTM I posted two pages back is as pure/harsh a demonstration of it as possible, all waveforms 0 except one channel playing 15, which generates the strongest possible harmonics of the switching frequency. I don't think there's too much need to analyze it here; jsr seems to have a handle on it.
Yea, that would have been a much better way to see the effects. I overlooked that post of yours. Cak just brought up a good point too, that I should have at least used the lowest volume. But either way, the data I have here still shows how the switch-noise affects the note, and it's very obviously inharmonic distortion; has nothing to do with the C fundamental, its quantization noise or non existant harmonic-overtones(despite the sine being heavily quantized).
jsr wrote:
I can do some recordings from a real cart later that can be compared with your recordings here. I wouldn't be surprised if there are some audible distortion there too.
That would be great! Please share if you ever get around to it, I'd love to hear what the hardware actually does.
*EDIT: Also,
my guess as to where those extra tones between my C-0 fundamental the the switch noise come from, is that, due to the sample rate, the higher frequencies tend to get sampled during scattered parts of the cycle, making them sound like lower frequencies.
The second example here touches on what I'm thinking.
What I mean is, gyms, that using a C tone might not be a good test; because the frequency of that C waveform itself will be aliased as well by the switching; and that aliasing is desired behaviour. (Probably not that strong an effect; but it still muddies the water a little, because that particular aliasing should be kept.)
I just tested it out. Red is your ring test and Blue is my C-0 test. They both match up perfectly; the defining peaks from the channel-switch aliasing is exactly the same.
gyms wrote:
due to the sample rate, the higher frequencies tend to get sampled during scattered parts of the cycle, making them sound like lower frequencies.
I'm almost certain that this is what we're dealing with here.
due to the sample rate, the higher frequencies tend to get sampled during scattered parts of the cycle, making them sound like lower frequencies.
I'm almost certain that this is what we're dealing with here.
That is the definition of aliasing, i.e. a frequency at N-X acts as an alias for frequency at N+X, where N = the nyquist frequency, or 1/2 of your samplerate.
And by the way, what I meant before is that unrelated to this beta's aliasing problem, is that the switching frequency is the N163's internal samplerate, which means it produces aliasing of its own. Additionally the channel has its own playback frequency which produces yet another layer of aliasing. This is why I suggested the other test, which is much simpler to evaluate: its result should be silent except for the switching tones and their harmonics.