Re: [hatari-devel] Sound lowpass filtering?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Thank you for the explanation. I think I now understand where the theory comes from.

So rather than being a voltage source, you treat the YM as a variable resistor, which connected with C10 forms a lowpass filter whose cutoff changes with that variation. This does explain why the effect would not by in my LTSpice simulation attempt, since I was looking at the circuit, and treating the YM as a simple voltage input source. I had just used the 0.96V to 1.35V range listed in its datasheet.

So OK, I can follow that reasoning based on this assumption about the YM's output.

> Note this model doesn't change the pull-up filter coefficients for
> the many different pull-up resistances. Instead it simply accounts
> for 1000 ohm pull-down, and a single lower resistance pull-up.

This feels like a large omission to me. Shouldn't we expect a different resistance at each level of the YM output then? We have 3 channels each with 32 levels. The approximation with only 2 steps seems like it should be valid for 1 square wave at 1 specific level, but the difference should be weaker at a lower amplitude, and stronger at a higher one. With 3 channels playing music, the levels will be rising and falling continually between many intermediate levels as the waveforms interact.

What is the 2 step approximation's point of reference? Is it for 1 square at full volume?

I'm not sure what the impact of this omission should be, but in the future I'll try to simulate the difference to investigate. I think the disparity in the results must be due to more than just this, but it could be a significant factor..

> There are more mailing lists here:
> http://hatari.tuxfamily.org/archive/berlios-ml-devel/

I have looked through these, but did not find further discussion about this that wasn't also present on the newer archive. If there is something specific there which you think is pertinent could you point it out?

> Note that you should use an oscilloscope across R8 to see the correct waveforms.

OK. I will write a test program soon that's easier to speak of more objectively than the music recordings I've given. The result should be measurable from the audio output without having to go inside the machine, which I'll try first, but I will eventually open up my ST and use an oscilloscope to see what I can verify too.

 Could you comment on the sound differences in the recordings I have made? The harmonic difference between the filters and my STF recording is _very_ strong, and it's the whole reason I'm investigating this. (Anders' STE and Falcon recordings demonstrate this too.)

-- Brad Smith

On Sat, Sep 2, 2023 at 3:36 PM David Savinkoff <dsavnkff@xxxxxxxxx> wrote:
There are more mailing lists here:
http://hatari.tuxfamily.org/archive/berlios-ml-devel/
-------------
Line 576 in hatari/src/sound.c explains:

 * The output of the YM2149 is modelled well as pullup resistors.
 * Thus, the three sound pins are seen as three parallel
 * computer-controlled, adjustable pull-up resistors.
 * To emulate the output of the YM2149, one must determine the
 * resistance values of the YM2149 relative to the 1k resistor,
 * which is done by the 'math model'.
-----------------
C10 is in parallel with the 1K resistor R8.
Note that a different resistance pulls up than which pulls down.

R8 (in AC parallel with) YM2149 pulls up.
R8 pulls down.

Thus there is a different waveshape for pull-up vs pull-down.
Note this model doesn't change the pull-up filter coefficients for
the many different pull-up resistances. Instead it simply accounts
for 1000 ohm pull-down, and a single lower resistance pull-up.

Note that you should use an oscilloscope across R8 to see the
correct waveforms.

On Sat, Sep 2, 2023 at 2:19 AM Brad Smith <rainwarrior@xxxxxxxxx> wrote:
> See line 407++ and 560++ in hatari/src/sound.c for source code and comments.
> See the log for this file, and the developers mailing list around the dates noted in the log
> for conversations among many people contributing to the topic.

Please understand that I have read all of the comments in sound.c already, multiple times, before asking for further explanation. I am earnestly trying to understand how this was arrived at, and I have been unable to piece it together. The question I am asking is not answered by the comments left in the file.

The filter was added on December 21, 2011.

The mailing list archives from before that date do not really have extensive discussion of this as you suggest.

I found two posts where you stated the following:
> The YM2149 is filtered at 7.7 KHz when it charges capacitor C10,
> and filtered at 2.1 KHz when R8 discharges C10. This is exactly
> what happens on a real ST.

I do understand that this is what the filter code does. My question is not what, but why. Why does that circuit behave in the way you describe? What mechanism of the circuit creates one filter while rising, and another while falling? I've never seen sound code that does this anywhere else. Is it unique, or is it an established technique that I could read more about?

I'm asking because I've tried to figure it out and I can't. I've read the code. I've read the comments. I've read the schematics. I've attempted to duplicate the effect in a circuit simulator. I've attempted and failed to find any hardware recording that matches this model. I'm trying as hard as I can to verify the truth of what you've offered, but I'm not able to, and I'm asking for your help to explain it.

Do you have anything to say about the sound recordings? Do you have any sound recordings that could demonstrate? The three separate hardware recordings given in this thread have already shown three machines that do not have the characteristic sound of that filter model. I am perfectly willing to believe there could be STs that really sound like your model, but I can't find the evidence for it.

I am not trying to dismiss what you've asserted. I'm trying to understand it, and I'm trying to verify the truth of it. If you can lead me to the evidence, I will do my best to confirm it. If it can't be confirmed, I have to advocate rejecting it.

-- Brad Smith



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/