Description

Guitar and Audio technology blog

Sunday 16 January 2011

Official website

To view my official website please go to www.aevansdevelopment.co.uk, website for myself Anthony Evans Audio technologist and developer.

Analysis of results

Low E 82.4Hz
The following image shows the peak frequency content when the Low E string is played with the gain and volume settings at 10 and the tone at 5.  The fundamental frequency is clearly visible at 82.4 Hz and the following peaks can be shown to be certain odd and even harmonics of the fundamental.  The second harmonic at 164.8Hz can be seen clearly, however there is also a peak at around 230Hz and 300Hz which does not match to a specific harmonic of the low E. 

 The image below shows the same audio halfway through the audible period and it can clearly be seen that most of the high end content is dropped, and it is observed throughout the clip that the high end content lowers considerably quickly with the first five or so harmonics remaining consistent throughout the audio.  It is also observed that during the audio the harmonics die off in an alternative cyclic manner, with peaks close to each other fluctuating alternatively producing the sustained cyclic period the amplifier produces.

   
 The image below represents the DI guitar played at the low e (82.4 Hz) both peak and half way through the audio.  Some of the odd harmonic content found in the previous amplifier output can also be found here, showing that the guitar itself produces harmonic content not related to the fundamental. The main difference in terms of frequency content is that the frequencies produced by the amplifier are much larger in amplitude and more exaggerated than the DI guitar.     

The image below shows the two waveforms next to each other (the amplifier output on top the DI below).  Just from looking it can clearly be seen that the amplifier adds a great deal of sustain and gain to the input.  From the odd shape of the waveform asymmetrical clipping can be observed as would be expected of tube applied overdrive.  Reproducing this asymmetrical distortion is key in producing the cyclic sustain and ‘warmth’ that tube overdrive offers.

Amplitude dependent wave shaping

One of the key characteristics of the amplifier even at peak distortion is the effect of input amplitude on the amount of distortion generated.  When playing softly even at full volume, even though there is an increase in overall volume/loudness there is less distortion than when playing harder.  It is important to incorporate this into my chebyshev waveshaping functions as the plug-in should only apply more distortion to higher input values.  A test has been produced separating the input into above and below 0.5 && -0.5 only applying the distortion polynomials above these values.  This works quite well however more subtlety is needed and is currently being developed. 


UPDATE



After some experimentation I have now got a working amplitude dependant distortion waveshaper using chebyshev polynomials.  The code looks at the amplitude level and depending on the number adds specific polynomials too the output variable.  The only problem is that it is extremely computationally excessive and needs to be tested on another pc to establish what the problem is.  I have a feeling as the amplitude changes so often there are too many process leading to too much distortion and sometimes crashing.  I am currently in the process of updating this as well as including a control on the amount of distortion in general.  

Monday 20 December 2010

Biquad notch filter


Following the last blog post more code has been written making a functioning biquad notch filter.  Although there is some aliasing produced the filter acts a notch filter with the peak around the 8khz range.  The filter works very well as a high pass filter as it cuts all low frequencies.  Switch statements are used to make sure the correct samples for previous inputs and outputs are used. The code is as follows:

void Laneycub10::processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames)
{
float* in = inputs[0];
float* out1 = outputs[0];
float* out2 = outputs[1];

float a0 = 1;
float a1 = 0;
float a2 = -1;
float b1 = 0.1;
float b2 = 0.9;
float xn0 = 0;
float xn1 = 0;
float xn2 = 0;
float yn1 = 0;
float yn2 = 0;
while (--sampleFrames >= 0)
{
float x = *in++;
switch (xcursor) {
case 0:
xn0 = xbuffer[xcursor];
xn1 = xbuffer[2];
xn2 = xbuffer[1];
break;

case 1:
xn0 = xbuffer[xcursor];
xn1 = xbuffer[0];
xn2 = xbuffer[2];

break;

case 2:
xn0 = xbuffer[xcursor];
xn1 = xbuffer[1];
xn2 = xbuffer[0];

break;

}

switch (ycursor) {
case 0:

yn1 = ybuffer[2];
yn2 = ybuffer[1];
break;

case 1:

yn1 = ybuffer[0];
yn2 = ybuffer[2];

break;



}


float y = a0*xn0 + a1*xn1 + a2*xn2 - b1*yn1 - b2*yn2;
xbuffer[xcursor++] = x;
ybuffer[ycursor++] = y;


if (xcursor == size)
xcursor = 0;
if (ycursor == size) //failsafe W cursor should never reach size
ycursor = 0;

*out1++ = y;

Saturday 11 December 2010

Chebyshev polynomial soft clipper

After an intial set up with the VST template, the max/msp chebyshev experiment has been repeated adding the harmonics with the polynomials using the VST sdk.  The code from the previous experiment has been modified to give each chebyshev polynomial its own variable which is calculated separately and then mixed (added) together at output.  This seems to produce stronger harmonic content and reduces clipping.  The nature of the chebsyhev polynomials are to scale the output values between 1 and -1.  The first five (including the initial frequency) harmonics are produced and from the waveform the frequency difference can clearly be seen.  The image below contains the effected output waveform above and the original source below.





Code:



void Laneycub10::processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames)
{
       float* in = inputs[0];
       float* out1 = outputs[0];
       float* out2 = outputs[1];

       while (--sampleFrames >= 0)
       {
              float x = *in++;


              float y = ((2 * (x*x)) -1);
              float y2 = ((4*(x*x*x))-(3*x));
              float y3 = (8 * (x*x*x*x)) - (8 *(x*x)) + 1;
              float y4 = ((16 * (x*x*x*x*x)) - (20 * (x*x*x)) + (5*x));
              *out1++ = y + y2 + y3 + y4 + x;
              *out2++ = y + y2 + y3 + y4 + x;

              }

Filter analysis

Part of the initial experiment was to analyse the tone stack output of the amplifier and how the controls (marked 0 – 10 under ‘tone’) varied the frequency response of the amplifier.  To measure the response white noise consisting of a full band of frequencies were generated and used as an input source for the amplifier.  The tone control was then moved from the 0 position to 10 and a recording of the output was made.  To record the amplifier a Rode NT5 condenser microphone was used due to its flat frequency response, although as standard a shure sm57 may be used for a guitar recording, the microphones specific frequency response boosts certain guitar friendly frequencies, for the experiment however the aim was to reduce the colouring of the microphone by as much as possible(Fig1 Rode nt5 frequency response).  An important aspect to take into consideration is the frequency response of the speaker in the amplifier as it also adds a great deal of colouration to the tone (Fig2 Celestion Tube 10 speaker frequency response).  Although less important in the tone stack analysis as all frequencies are considered the speakers frequency response is a vital consideration for the waveshaping algorithm design.  In Fig 3 (Frequency plot of amplifier with noise) the top line, representing the tone control at 10, almost identically represents the frequency plot of the speaker specification (for example the drop in dB around the 10kHz area).  The bottom line in Fig 3 represents the tone control at 0 so the difference between the two lines can be seen as the response of the tone stack as its controls are adjusted from 0 to 10 (minimum to maximum).  There is a huge boost of around 30dB in the low frequency spectrum and an average of around a 15dB boost in the mid and high range frequency spectrums.  More detailed designs of the tone stack can now be completed based on these findings.  


Rode NT5 frequency plot

Celestion Tube 10 frequency plot

Laney Cub 10 tonestack plot with white noise
The spectrum tool used is a great freeware plug-in from blue cat audio and can be downloaded from: http://www.bluecataudio.com/Products/Product_FreqAnalyst/

Commercial constraints

It has come to my attention during my initial specification that the research I am completing may well have some commercial relevance and hence I am going to have to restrict the information I post on the blog.  I will however update with progress and provide the final plug-in however I will be unable to provide code or specific details on the code.