Thursday 16 April 2015

The final report

Well, this log book blog was neither as concise or well written as I had aimed, so I am going to start a new one that follows my career from here on.

You can however find the report and all attached stuff in the folder below.
Thank you those who helped me along the way, particularly Adam Hill, John Taylor, Brian CJ Moore, Simon Henin, Floyd Tool, and my Beth.


Monday 13 April 2015

How things are today (just short of submission) & the results

The report has been printed and bound.
I am now just rounding off the log book, by adding the posts that I have missed on important stuff.

The Results

What did I find? 




Here is the bullet-point analysis of what this all says:
  • Loudspeaker data and headphone data follow extremely similar tends
  • Listener to listener data follow very similar trends
  • People can match loudnesses reasonably accurately
  • Amounts of nonlinear distortion effect different people differently, the standard deviation of data increased with greater amounts of distortion.
  • the level and amount of distortion had an influence on how listeners perceived equal loudnesses
More on this tomorrow

Thursday 12 March 2015

Rnonlin

Rnonlin is a metric that measures the amount of perceptible distortion in a distorted track, when compared to its original 'clean' counter.

It was developed by Moore, Tan and others in the paper:

Predicting the Perceived Quality of Nonlinearly Distorted Music and Speech Signals


I have implemented this metric in software, via Matlab. This software as well as LUFS can be found in the linked folder.

What it essentially does is:
  • Model the filtering effects of the outer & middle ear on both track versions,
  • Filters both track versions through an ERB based Gammatone filter array, to simulate the basilar membrane
  • Creates a weighting coefficient set using the maximum level comparisons for the distorted version for each packet of a 30ms sliding window
  • Finds the maximum cross-correlation between both versions of the track
  • Does this for lags of -10ms to + 10ms
  • weights these normalised maximum cross correlations, so all used coefficients sum to 1
  • sums across the 40 filtered versions of the signal per packet
  • mean averages per packet
Papers like http://projekter.aau.dk/projekter/files/9852082/07gr1061_Thesis.pdf show that it gives excellent correlation with listener perceived levels of distortion.

I will use this to derive how much perceptual distortion is in a track, which is important as I am trying to stay on the fringe of distortion perceptibility, as not to incur a response derived by the fact that the distortion is loud and present, and more the effect of the effect of the particulars of the distortion in and of itself.

https://onedrive.live.com/redir?resid=563e4881c8b0b60!6782&authkey=!ALzVdJrzlx7dS68&ithint=folder%2c




Wednesday 4 March 2015

Just getting this thing up to date with the process

The Tests

So, after I got the listening test calibrated, I started testing in and around Markeaton Street. I have jsut over 21 participants worth of data at the moment. Testing is ongoing, but I aim to start creating a data analysis model soon.

Data Analysis

My current data is very promising in many respect, and not so much in others. Most of my data sets correlate, and there is consistency in the point to point ratio of change, even if there is a clear listener to listener shelving difference. Some tracks have a much wider variation of data than others, but everything looks promising. I have the bare minimum of test data in any case.

Writing the Report

I have started filling out the report, Including a large wadge of the literature review and bits. 

Ongoing

As of next week I will keep testing but will start writing a model of the data set. 

More to come as usual

Thursday 19 February 2015

THD thought experiment - Adendum


So what do we know about THD measurements?
We know that if we take a regular sine wave, clip it and compare the measurements in the frequency domain we can see how much harmonic distortion there is.
So. If this is a valid way of measuring a distortion statistic, without looking at intermodulation; we should be able to clip two or more signals which ARE NOT frequency multiples of each other, and if THD is accurate we should see a generic harmonic pattern for each fundamental with no extra noise.
Below is an image of a signal before and after clipping, at 0.5. This signal had 3 components: 1kHz, 105Hz & 6318Hz.


As you can see, that hypothesis is totally incorrect. ‘But wait’, I heard you cry, ‘You are processing in the time domain and analysing in the frequency domain’.
Below is an example of the same thing, but I have clipped the signal in the frequency domain to the same level.
The difference is, we don’t amplify signals and pass them to loudspeaker drivers in the frequency domain.
We also don’t listen to stuff being played in the frequency domain, although that is the conversion our ears do.
If you clip something in the frequency domain, you aren’t changing the numerical pattern that is the signal. You are changing the level of the harmonic components within the signal.

If you clip something in the time domain, you are literally changing the number sequence, and thus modifying the harmonic content of the signal (the sequence is just the amalgamation of infinite sinewaves, right?) literally changes the frequency content of what you are hearing more than the magnitude of the frequency content. As such, if you used a nonlinear equation that changed the probability of number values to include an even distribution of +x over a given period, you effectively add more of a frequency pattern i.e. bass spectrum stuff.  I am talking about inverse-filtering in the time domain. Kind of similar to what a vacuum tube does by being nonlinear. Exciting. 

8/10/14 - THD - Part 2



As I mentioned in the previous blog post, THD measurement allows us to see the response of a nonlinear system to a spectrally pure sine wave.
This means we can quantify, in the frequency domain how linear a system is in one dimension. This is also the flaw of THD. As we will see in later distortion analysis, the effect of distortion on a complex signal is far more variable and complex than that of a sine wave.
Below is an fft graph of a 1kHz sine wave, being clipped at a ratio of 1:2 i.e. the output of the system at the sine to (if the system was linear in response) would be a single tone at 1kHz of 0.5.

As we can see, there is harmonic content distributed at multiples of the fundamental frequency. The magnitude of the fundamental is reduced, but is still greater than the 0.5 intended limit. This is due to the fact that this is a graphical representation of the magnitude of frequency components, of a signal which has been analysed using a Fourier transform. Such is the companies between frequency domain analysis of changes that are made in the time domain. If we did a correlation between the distorted and non-distorted vector, we would be presented with a coefficient of 0.9739, which means that the change in values within the vector for a signal of roughly 23% THD, presents a 0.9739 similarity to the non-distorted signal.  
If you have ever heard something with 23% THD present, you will know that it doesn’t sound 97% similar to the non-distorted version, anecdotally. So where does this leave us? We cannot use THD to analyse complex signals, because there is inherent interaction between the frequency content a complex signal and the components caused by the nonlinear behaviour. Another angle which is not looked at In this view is the effect of phase on the signal. We need a way of looking at the effect of a nonlinear device on more than one frequency component.
We can also see that the first harmonic is dominant in this signal, and far out-weighs the energy of the following components of the signal. However, this relationship may change depending on the nonlinearity. An example of this is taking the square of the signal. This pitch-shifts the output signal, as can be seen below. Not that no other frequency components occur, and the amplitude is limited to 0.5.

It is possible to modify a nonlinear behaviour to give a pattern which is far less predictable that those shown previously, as can be seen below. This came from using the nonlinear expression (2.5*atan(0.9*x)+2.5*sqrt(1-(0.9*x).^2)-2.5) - x;
Performed on the sinewave vector x.
This is the result:



As it happens, this behaviour sounds more like a bitcrusher, where some of the other behaviours sounded rough and distorted in a more regular or recognisable pattern.

I WILL LATER ADD SOME REFERENCES TO LOOK AT

I have found a number of papers discussing methods of looking at THD in the time domain, but nothing that is either well written or seems to work.
There is another method for analysing the effect of a nonlinear device on a signal. This is Intermodulation, which I will discuss in the next post.

In the next week I am to look at ways of comparing distorted and clean signals.

Tuesday 17 February 2015

Distortion and THD 1 – 1/10/2-14

THD 1 – 1/10/2-14

Distortion

Distortion is characterised in the Master Handbook of Acoustics (Everest & Shaw), as ‘any change in the waveform or harmonic content of an original signal, as it passes through a device. The result of nonlinearity within a device’.
This distortion not only includes having a variable input/output relationship with the signal, but may also modify the basic content of the signal.
One example of the behavioural characteristics of this nonlinearity may be the change of harmonic content within the signal with respect to the frequency domain.  There are two predominant measures of this which I will discuss briefly in the coming posts; Total Harmonic Distortion and Intermodulation Distortion. These are two methods which have been used since the 1940s, to characterise the effect a device has on a signal. There is a big catch to both of these methods, which I will also discuss.

Total Harmonic Distortion

Total harmonic distortion (THD) is the measure of a system response and viewed in the frequency domain, when the system is given an input of a spectrally pure sine wave at a given frequency (often 1kHz).
The total energy of the output (in the frequency domain) is measured, and compared with the level of the excitation tone. This relationship is characterised as a percentage, and known as the percentage of total harmonic distortion.
The benefits of this method of nonlinear behaviour characterisation, is that you can clearly see (graphically and numerically) the effect a device has on a signal. The down side is that this method by definition only works with a spectrally pure signal, and in modern measurement systems the noise floor of the system must also be taken into account. Pure sine tones do not accurately represent the complex and highly variable signals presented as music, and therefor do not relate to what realistically occurs when a system distorts musical signals. Furthermore, links to the perception of distortion of pure tones may not relate to the perception of the distortion of complex tones.
For more information: see Temme 1992 – Audio Distortion Measurements – a Brual and Kjaer text on methods of measuring distortion.
Shmilovits 2005 characterises THD in his paper ‘On the definition of Total Harmonic distortion and its effect on measurement interpretation’ as either a comparison to a signals RMS, or its harmonic content and advocates the latter. As such, I will be using this method in the analysis on the effect of the nonlinear devices.
In the following blog post, I will give an example of a total harmonic distortion measurement, and compare what is measured with a complex signal and a spectrally pure signal.

 

In the coming week I plan to try and find a method of using THD measurement to characterise the distortion effect of a device on complex music.
I will also look for supporting literature.

I have found a number of papers on the perception of distortion, but none specifically looking at the links to loudness perception. Generally most work is done on quality.