Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
[-1 +1 ] range
Avatar
Sim1
Member
Members
November 27, 2020 - 4:09 am
Member Since: February 7, 2020
Forum Posts: 14
sp_UserOfflineSmall Offline

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.

Avatar
W Pirkle
Admin
November 27, 2020 - 11:09 am
Member Since: January 29, 2017
Forum Posts: 573
sp_UserOfflineSmall Offline

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 

Avatar
Sim1
Member
Members
November 27, 2020 - 5:56 pm
Member Since: February 7, 2020
Forum Posts: 14
sp_UserOfflineSmall Offline

Thank you very much. So, for this example, +15 V would be +1 and instead -15 V would be -1 and I start from here to map the other quantities with a proportion. Right?
And for other systems it changes according to the situation, such as maximum and minimum tensions. Right?

Avatar
W Pirkle
Admin
December 4, 2020 - 3:45 pm
Member Since: January 29, 2017
Forum Posts: 573
sp_UserOfflineSmall Offline

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. 

Avatar
Sim1
Member
Members
December 14, 2020 - 9:37 am
Member Since: February 7, 2020
Forum Posts: 14
sp_UserOfflineSmall Offline

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). 

Avatar
W Pirkle
Admin
December 28, 2020 - 8:55 am
Member Since: January 29, 2017
Forum Posts: 573
sp_UserOfflineSmall Offline

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 

Forum Timezone: America/New_York

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, Valentin

Moderators: W Pirkle: 573

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