Csound Csound-dev Csound-tekno Search About

[Csnd] Calculate Transfer Function Based on THD Measurements

Date2017-12-09 22:06
FromEmmett Palaima
Subject[Csnd] Calculate Transfer Function Based on THD Measurements
AttachmentsTHDGraph.png  
Hi, I am working on a project where I am trying to digitally replicate the sound of analog gear. I have taken some test measurements in order to get a starting point, measuring both frequency response and total harmonic distortion.

Frequency response seems fairly straightforward to model, but I am unsure of what method I should use to produce similar levels of harmonic distortion. 

Basically I have a graph showing harmonic distortion levels at each frequency, and would like to create a transfer function that models this. Can anyone recommend a good place to start?

Here is what the graph looks like: 


Inline image 1
Mainly just looking for a place to start so all advice is greatly appreciated.

Thanks,
Emmett
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-12-10 09:00
FromRichard
SubjectRe: [Csnd] Calculate Transfer Function Based on THD Measurements
AttachmentsTHDGraph.png  

Csound has many distortion opcodes. But since this needs to be frequency dependent, you might try with multiple band pass filters, each followed by a distortion according to your graph...

Richard


On 09/12/17 23:06, Emmett Palaima wrote:
Hi, I am working on a project where I am trying to digitally replicate the sound of analog gear. I have taken some test measurements in order to get a starting point, measuring both frequency response and total harmonic distortion.

Frequency response seems fairly straightforward to model, but I am unsure of what method I should use to produce similar levels of harmonic distortion. 

Basically I have a graph showing harmonic distortion levels at each frequency, and would like to create a transfer function that models this. Can anyone recommend a good place to start?

Here is what the graph looks like: 


Inline
            image 1
Mainly just looking for a place to start so all advice is greatly appreciated.

Thanks,
Emmett
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2017-12-10 21:02
FromEmmett Palaima
SubjectRe: [Csnd] Calculate Transfer Function Based on THD Measurements
AttachmentsTHDGraph.png  
Okay. How would I correlate the transfer function to the distortion percentages I have measured? Is it a matter of blending the wet and dry signals of the distortion transfer functions? How can I go about matching a blend to a percentage?

I know that 3rd order harmonic distortion can be approximated by the transfer function:

y = x - (1/3)x^3

and 2nd order by:

y = x - (1/2)x^2 * sign



On Sun, Dec 10, 2017 at 4:00 AM, Richard <zappfinger@gmail.com> wrote:

Csound has many distortion opcodes. But since this needs to be frequency dependent, you might try with multiple band pass filters, each followed by a distortion according to your graph...

Richard


On 09/12/17 23:06, Emmett Palaima wrote:
Hi, I am working on a project where I am trying to digitally replicate the sound of analog gear. I have taken some test measurements in order to get a starting point, measuring both frequency response and total harmonic distortion.

Frequency response seems fairly straightforward to model, but I am unsure of what method I should use to produce similar levels of harmonic distortion. 

Basically I have a graph showing harmonic distortion levels at each frequency, and would like to create a transfer function that models this. Can anyone recommend a good place to start?

Here is what the graph looks like: 


Inline
            image 1
Mainly just looking for a place to start so all advice is greatly appreciated.

Thanks,
Emmett
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2017-12-10 21:49
FromRichard
SubjectRe: [Csnd] Calculate Transfer Function Based on THD Measurements
AttachmentsTHDGraph.png  

Blending the wet and the dry, something like that, and a lot of good listening and trial and error. My idea was just a quick and dirty approach. Your graph shows distortion percentages I think, not orders of distortion.

If these are known the formulas you mentioned could probably be implemented with an UDO.
As this is non linear, convolution cannot be used as such, but this link gives some clues how it could be used:

https://www.sweetwater.com/forums/showthread.php?6015-modeling-distortion-with-convolution

Richard


On 10/12/17 22:02, Emmett Palaima wrote:
Okay. How would I correlate the transfer function to the distortion percentages I have measured? Is it a matter of blending the wet and dry signals of the distortion transfer functions? How can I go about matching a blend to a percentage?

I know that 3rd order harmonic distortion can be approximated by the transfer function:

y = x - (1/3)x^3

and 2nd order by:

y = x - (1/2)x^2 * sign



On Sun, Dec 10, 2017 at 4:00 AM, Richard <zappfinger@gmail.com> wrote:

Csound has many distortion opcodes. But since this needs to be frequency dependent, you might try with multiple band pass filters, each followed by a distortion according to your graph...

Richard


On 09/12/17 23:06, Emmett Palaima wrote:
Hi, I am working on a project where I am trying to digitally replicate the sound of analog gear. I have taken some test measurements in order to get a starting point, measuring both frequency response and total harmonic distortion.

Frequency response seems fairly straightforward to model, but I am unsure of what method I should use to produce similar levels of harmonic distortion. 

Basically I have a graph showing harmonic distortion levels at each frequency, and would like to create a transfer function that models this. Can anyone recommend a good place to start?

Here is what the graph looks like: 


Inline image 1
Mainly just looking for a place to start so all advice is greatly appreciated.

Thanks,
Emmett
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here