Monday, 26 November 2012

Week 7 - Spectrum Filtering

This entry will look at how a sound can be manipulated by altering its spectrum.

First, let's create a sine wave. This can be done through the expression evaluator as done in the previous blog entry.


In this above image the sine wave is displayed at a very close zoom level. Close enough to make out the individual samples quite clearly. Although the wave form is jagged, it's very consistent and enough samples are created to faithfully recreate a sine wave at 1KHz. This will be important later, as it's the wave form we intend to recover from noise.

To that end, we'll need some noise! You can generate white noise in Goldwave by once again using the expression evaluator, only of course this time choose "white noise" in the presets. It will add an expression like "rand(2)-1" to the expression field.

Pictured below is the white noise, as well as how it looks in the Spectrum Filter.


The filter on the X axis of the graph is logarithmic of course, so what's seen is a roughly equal spread of frequencies for the generated wave.

Mixing

Now to mix this with the 1KHz waveform we generated earlier.. We do this by going to Edit -> Mix.


Note that you'll need two wave forms open at once in order for Mix to be selectable. The result of mixing the waves, as well as the resultant view in the Spectrum Filter can be seen below.


There is a clear spike in the 1KHz region, for fairly obvious reasons. It's also quite obvious in the spectrogram below:


The 1KHz pure tone stands out as a bright green line among the blue white noise.


Restoring the tone - Equalizer

It's possible to largely restore the original tone, the rest of this entry will be concerning itself with methods of how this might be achieved.


This first attempt uses an equalizer to do the job. All sliders have been turned down to -24 apart from the 1KHz slider. The result can be clearly seen in the spectrogram on the far right, as the white noise has gone from blue to purple indicating that the intensity of the noise is much less than it was. It's still there, however ad as the equalizer doesn't cover precise ranges the noise in the immediate vicinity of the pure tone is still quite prominent.


When we look at the wave form up close, while it does resemble a sine curve overall there is a lot of jitteryness in it. These variations are not consistent at all, so the white noise will be quite audible still.


Restoring the tone - Spectrum Filter

The spectrum filter can also be used for this task. This is achieved by altering the yellow line in the filter, which can boost or reduce areas of the spectrum. Clicking on the line will create an anchor, which allows for specific parts of the spectrum to be altered in different ways.

In this case, anchors are placed and dragged to form something like a triangle centered on the tone that's to be recovered from the noise.


The result is quite clear in the spectrum, the noise isn't even visible any more. Let's see what effect this has had on the waveform up close.



There is still some jittery-ness in the waveform, but it's much more uniform than it was post equalizer.  


Conclusion

There are a number of ways that a digital wave can be manipulated in order to either pick out particular tones or to do the opposite and remove frequencies from the spectrum. It can be use to remove unwanted noise or frequencies that may not be considered relevant or needed for a given waveform.

Week 6 - Harmonics

This post will be exploring the effects of applying harmonics to a given waveform, as well as generating wave forms from mathematics.

For the purpose of this experiment we'll need to work on a very small waveform of only a few cycles in length. Far too short a time period for anyone to hear it, so the sample must be played on a loop. You can do this by clicking on the button indicated below in the control window.


This will open up the window displayed below. Set it as pictured and it'll loop away on playback with the yellow playback button.


Creating a Waveform 

Now that we've ensured we'll be able to appreciate any waveform we've created, let's make a waveform. To do this, we will need to use the expression evaluator. You can find it in the menu pictured below.


Once in it, you can just put an equation into the expression field and make a wave based on that, but you can also choose from a list of presets that will generate a formula for you. For our purposes we want a sine wave at 500Hz. Clicking on it in the presets will give us the result below.


With that entered, click OK and the waveform will be generated. The resultant wave is pictured below



The expression evaluator can be used to add multiple harmonics of a wave. The values entered into the expression field in the below screenshot add the 3rd, 5th, 7th and 9th harmonics to the same sine wave we created before. 


The resultant waveform is pictured below.


What was a collection of sine waves is starting to strongly resemble a square wave. 

The wave's shape differs depending on the harmonics used. This next wave form is built up from the 2nd, 3rd, 4th and 5th harmonics of the original 500Hz sine wave. 


The result strong resembles a sawtooth waveform.