Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crossover distortion in triode pre-amp stages #13

Open
FalconBry opened this issue May 10, 2022 · 17 comments
Open

Crossover distortion in triode pre-amp stages #13

FalconBry opened this issue May 10, 2022 · 17 comments

Comments

@FalconBry
Copy link

Hello,
Very nice work. Thank you.
However, all the amp models suffer from too much crossover distortion.
That is the constant fizzing sound in the background you hear even when there is no clipping at the stages.

Looking at your faust dsp code I noticed that all your tube clipping stages process pos/neg halves separately.
Usually this is done only in push-pull power amp simulation.
Most likely the 2 generated LUTs are not exactly matched resulting in a broken waveform at the crossover point.
To investigate this further, I looked at vox_ac30_brilliant.dsp and took only the first clipping stage;

s01_stage1clip =
<:
ba.if(signbit(
), s01_stage1_neg_clip, s01_stage1_clip)
:>_

with {
    signbit = ffunction(int signbit(float), "math.h", "");
    s01_stage1_clip = ffunction(float s01_stage1clip(float), "generated/stage/vox_ac30_brilliant/s01_stage1_table.h", "");
    s01_stage1_neg_clip = ffunction(float s01_stage1_negclip(float), "generated/stage/vox_ac30_brilliant/s01_stage1_neg_table.h", "");
};

process = *(pregain):s01_stage1clip;

I then wrote a test audio plugin and indeed, the crossover distortion occurs there too.
To be clear, triode preamp stages do not produce crossover distortion.
Only push-pull power amp circuits do that.

Could you please shed some light on the issue so we may fix it ourselves?
Like;

  • was this done intentional,
  • can we correct this by means of some offset in the LUTs?
  • how were the LUTs generated etc.

Please don't take the above the wrong way.
It is meant as constructive criticism.
Regards,
Falc.

@sadko4u
Copy link
Owner

sadko4u commented May 10, 2022

Hello!
All faust scripts were generated and then manually edited by using the Guitarix DK Builder tool.
So this is actually what the tool has generated.

@FalconBry
Copy link
Author

FalconBry commented May 10, 2022

Hello, Thank you for answering.
I understand that the stage tables were created with the DK/circ_table_gen.py tool.
But what input parameters/files did you use to create them?

Further, where do the ampsim/xxx.dsp files come from?
Are they also generated? If so by what?

@sadko4u
Copy link
Owner

sadko4u commented May 10, 2022

They all are generated from these schematic files:
https://github.com/sadko4u/tamgamp.lv2/tree/master/res/schematics

The way of how to use DK Builder tool is given here:
https://linuxmusicians.com/viewtopic.php?f=44&t=19806

I've reproduced the schematic of each cascade according to what I've found in Internet and combined all cascades together into one single faust file for each amplifier.

@FalconBry
Copy link
Author

Aha, there it is. In that forum topic.
The negative and positive halves I was talking about.
Something went wrong in that approach.
Stitching those halves together is what is causing the (unrealistic ) crossover distortion.
I will digest and investigate some more.
Thank you for the info!

@sadko4u
Copy link
Owner

sadko4u commented May 10, 2022

If you'll find solutions, you're welcome to submit PRs and fixes.

@FalconBry
Copy link
Author

I will. Thanks again.

@FalconBry
Copy link
Author

FalconBry commented May 10, 2022

Oh, one more question;
I read that you simulated only the pre-amp section of the modeled amps?
That is; you did NOT model the push-pull power tube stages?

@sadko4u
Copy link
Owner

sadko4u commented May 10, 2022

I don't remember at this moment.
I think you'd better look into schematics to see what I have simulated.

@FalconBry
Copy link
Author

Ok. Thank you.

@brummer10
Copy link

Aha, there it is. In that forum topic. The negative and positive halves I was talking about. Something went wrong in that approach. Stitching those halves together is what is causing the (unrealistic ) crossover distortion. I will digest and investigate some more. Thank you for the info!

I've a short look at the tables and see that sig_max is set to 10.0. That may be the culprit. To generate the tables we send a numpy array from zero to sig_max to the circuit and capture the response. Those array represent the expected input signal range, which properly never will be much higher then 1.0. Looking at the table values it seems as if the circuit is smoked up, as the response is going down to near zero. You may not noticed that in the audio because 90% of the table will never be used in real, because the input signal never gets so high to force a response at that level. It may help to regenerate the tables with a lower sig_max value ( default is 1.4) so that the resolution of the table moves into the range which you really use.
Additional, often a dcblocker or/and a lowpass filter on the input helps to clear the table response.

@FalconBry
Copy link
Author

"which properly never will be much higher then 1.0. "
That might be the case in solid state circuitry, but in tube amp stages gate signals are much higher especially in distortion scenarios.

@brummer10
Copy link

Keep in mind we talk about the input signal, not the one which may result by amplification of the circuit, that comes on top.

@FalconBry
Copy link
Author

Yes of course the input signal at the first triode stage is usually at guitar level (~1v).
But the following cascaded triode stages are getting a much higher input voltage so those tables can not be made smaller.

@brummer10
Copy link

Well, we are already in the digital domain here. We don't calculate the response voltage, that is already part of the circuit simulation and therewith part of the calculation for the response, but the difference from input to output. This way we keep the table in the range of the digital domain and lower the dsp load which is needed to calculate the response. This calculation is already done by the dkbuilder.

@FalconBry
Copy link
Author

In other words; everything is scaled down to fit -1.0 .. +1.0 range?

@brummer10
Copy link

It's not that easy. It depends as well were you split a circuit. Hence there are options in the build-plug.py file to adjust the signal range, as well as the table stepper, and other related stuff. But as I said for the circuits simulated here, it looks to me wrong to use a input signal such high.

@FalconBry
Copy link
Author

I see. Then I will try to generate new tables and see if the "crossover distortion" disappears.
Thanks for your input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants