How do we map analogue values within the range -1 +1? I'm reading the addendum on valve emulation but I don't understand how, after the whole elaboration, we do the "re-ranking" to the range -1 +1. I'll give a further example to better explain. If I wanted to make a plugin that models only an ideal non-inverting op amp (Vout=(1+R2/R1)Vin)how do I map the values inside -1 +1? If I consider Vin as the input audio samples to the plugin, and for example the gain is 10, how do I do it? I can't Just multiply each sample by 10 because I could go out of the range -1 +1. How do I manage this? And besides, what would change if the gain was 100? So my question is how to relate all these quantities to make elaborations inspired by analog circuits.

The digital range of [-1.0, +1.0] maps to the analog range that is determined by the rails of the analog system. If your op-amp example were ideal, and running on +/-15V, then your *theoretical* max input before clipping would be 30Vpp (it will usually be +/-0.7 to +/-1,4V inside this range, but that is inconsequential for the example).

That 30Vpp input would map to the floating point digital range of [-1, +1]. And, if you applied an input of 30Vpp to your analog system, then you would likewise clip it if you applied a gain of x50 or x100.

So the answer is to use a x50 multiplier just as you normally would - it's all the same, just mapped to a different range. This also gets into the area of dynamic range, nominal signal levels, and headroom. All the same stuff applies, just remapped to that range.

Will

Well, the system rails govern the maximum signal value, and that all scales to [-1, +1], so yes it scales depending on the system voltages (tensions). But as long as you are dealing with linear circuits, and you aren't trying to model the noise floor, then that is less important (until your rails drop so low that the components are operating in a nonlinear range). For tubes and nonlinear devices, the rails play a much larger role in the behavior of the circuits in a way that you'd need to worry about.

Thank you. I’m learning a lot. I was reading the vacuum tube addendum and I saw that you treated input samples values like volts. This brings you to exceed the range [-1 +1]. After some processing you did some scaling but I don’t understand how:

I’m talking about pag. 97 (but I think this will apply everywhere)where you perform final output scaling and inversion. Why scaling is performed here if we multiply by -1? Is not only inversion? How the signal get rimapped into [-1 +1]?

and what do you mean when you say (pag 95) “I use a lot of headroom for the ClassAValve modeling”?

Thank you very much Will. Sorry for all these questions but I’m really passionate about these things and I want to do amp simulations one day (as I play guitar and I am in my third year of electrical engineering).

The headroom and volts issues are basically the same. The digital input/output sample values must lie in the range of [-1, +1] however, internal to the plugin, the values may grow as large as the float or double datatypes allow. That is the "headroom" that I am talking about. As long as the final output is scaled back to the unity bipolar range, everything is OK.

For the 12AX7 example, the maximum input signal to the grid is about 3Vp-p. That would correspond to an input range of [-1 +1].

Hope that helps - if you are not familiar with the terms dynamic range, signal-to-noise ratio, headroom, and noise floor (which are critical for analog audio) then do some research on it; the Yamaha Sound Reinforcement Handbook is a great source for that info.

Will

Most Users Ever Online: 152

Currently Online:

7 Guest(s)

Currently Browsing this Page:

1 Guest(s)

Top Posters:

Chaes: 51

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

jim: 34

JimmyM: 33

Gwen: 32

Member Stats:

Guest Posters: 1

Members: 696

Moderators: 1

Admins: 5

Forum Stats:

Groups: 13

Forums: 41

Topics: 757

Posts: 2894

Newest Members:

Jas, Rowan, sojourn, fabhenr, rg1, Niklas, Wutru, Tim Campbell, Danny Jonel, ValentinModerators: W Pirkle: 573

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 573, VariableCook: 3