34
CS155 Week 6 Filtering and Equalization

CS155 Week 6

Embed Size (px)

DESCRIPTION

CS155 Week 6. Filtering and Equalization. - PowerPoint PPT Presentation

Citation preview

Page 1: CS155 Week 6

CS155 Week 6

Filtering and Equalization

Page 2: CS155 Week 6

This is the first lecture of a new stage of the course, where we will study the routines of artistic digital audio processing. Each of these routines will bring about fundamentals of computer music, which we will take advantage of the opportunity to study.

Today, we are going to look at filtering (also known as equalizing) and its own concepts of magnitude response, center frequency, and bandwidth. We’ll also find out about decibels and Q-values, helpful to the comfortable artistic handling of filters.

Page 3: CS155 Week 6

Filtering

The aim of filtering is to amplify, attenuate, or simply remove some of a sound’s frequency components.Filtering is commonly referred to as equalization, which strictly speaking is only a practical application of filtering: that of canceling spectral side-effects a circuit might have had on a traveling signal.In fact, filtering can be found many practical purposes. Yet, it’s audible effect on sound can be very powerful, and it is thereby very much used to artistic ends. Here follows an easy example of a fast hit-hat:

… now applied a dynamic filtering onto:

Page 4: CS155 Week 6

The most elementary types of filters are the low-pass, high-pass, band-pass and band-reject filters. The shapes of their respective magnitude response are so simple and intuitively meaningful, they are often used as self-denoting symbols in filter units, as shows that of the VST synthesizer a1 on its upper right-hand corner:

Page 5: CS155 Week 6

For example, consider the following pulse train sound wave:

Page 6: CS155 Week 6

Now consider its spectrum:

… and on the next slide, the magnitude responses of the four elementary types of filters: low-pass, high-pass, band-pass and band-reject:

Page 7: CS155 Week 6
Page 8: CS155 Week 6

The output of a filter through which is sent sound wave is another sound wave, whose spectrum is the product of that of the input and the filter’s magnitude response.

Observe next slide, to visualize the phenomenon. There are presented the output spectra of those low-pass, high-pass, band-pass and band-reject filters, when fed with the above pulse train:

Page 9: CS155 Week 6
Page 10: CS155 Week 6

Now let us zoom on a single period of the pulse train, and observe it against the output of each of these filters…

Page 11: CS155 Week 6
Page 12: CS155 Week 6
Page 13: CS155 Week 6
Page 14: CS155 Week 6
Page 15: CS155 Week 6

The reason why the effect is not really audible in the previous low-pass and band-reject configurations is because, when the human ear is at its most efficient between 1,000 and 5,000 Hz, the magnitude plots above show that only the high-pass and band-pass configurations significantly reduce the energy over that frequency range.

To demonstrate better the potential of filters, we apply next a more complex, yet more flexible filter, Reson, onto our buzz:

Page 16: CS155 Week 6
Page 17: CS155 Week 6
Page 18: CS155 Week 6
Page 19: CS155 Week 6

As you can see, Reson is a band-pass filter, like the one we saw above. What makes it special, however, is that its center frequency and bandwidth are adjustable, and can even be varied in real time.

The center frequency of a band-pass filter is the frequency at which its magnitude response features its peak. This can easily be visualized from the previous figure.

Page 20: CS155 Week 6

The bandwidth, on the other hand, is the width in Hertz of the band-pass region between the two points where the curve crosses the 0.707 horizontal axis:

Page 21: CS155 Week 6

Cubase features a very elaborate type of filter, which combines in one same unit a low-pass, a high-pass, and two band-pass/reject filters, allowing the easy design of pointy magnitude responses.

After setting the output of a MIDI channel to a VSTi, you can access the Channel Settings of the latter by clicking on the e immediately to the right of your VSTi name:

Page 22: CS155 Week 6

… and there will you find the equalizer for your VST channel:

Page 23: CS155 Week 6

Here we have to stop to stress and explain two things:

1. The vertical axis of the magnitude plot isan axis of decibels.

2. The figures above the lower knob of the second and third stripes are figures expressing the Q.

An explanation for each of those follows.

Page 24: CS155 Week 6

Decibels (dB)Decibels are used to present the magnitude of a signal in a way which reflects better the way the human ear perceives loudness (more on that when you study acoustics next year). Mathematically, the equivalence is as follows:

dB=20log10(magnitude)and therefore,

magnitude=10dB/20.

It is worthwhile noticing that a magnitude value of 1 equates to a decibel value of 0 (because the log of 1 is 0), and conversely, that a decibel value of 0 equates to a magnitude value of 1 (because x0 is always 1, whether x is 3.14 or one million). Have a look at your equalizer window before messing around with it, and you’ll see that it’s magnitude response is initialized as a horizontal, neutral line centered at 0dB, and not at 1.

Page 25: CS155 Week 6

We can also take a look at the magnitude responses of our elementary filters on their original linear, normalized magnitude scale (red), and compare to when they are mapped on a dB scale (blue):

Page 26: CS155 Week 6

And now an audio example, to show you how more handy is loudness level handling on a decibel scale. Here, a voice sample is played ten times, first time at a tenth of its normalized magnitude, then at two tenths, and three tenths, etc, up to full power:We notice that the difference in loudness from step to step becomes fainter and fainter as we go up in magnitude.

Now we play the sample ten more times, except this time it goes from -54dB till 0dB in steps of 6dB (the magnitude is doubled each time):This time, no problem, each step is clearly audible.

Page 27: CS155 Week 6

The Q

The Q is defined as the ratio of the center frequency of a band-pass filter to its bandwidth:

The motivation of using such a value once again stems from perceptual considerations: equal steps in ‘height’ (‘low’ as opposed to ‘high’ pitches) are achieved with exponential steps in frequency.

To illustrate this, we are first going to hear 24 sinusoids, beginning from A2, each separated by one semitone, just as if you were playing all the keys of a piano in ascending order, from A2 till A4. This outlines an exponential frequency scale defined by 220k/12Hz, where 220 is the A2 frequency, and k the semitone number (going from 0 till 24):

BW

cfQ

Page 28: CS155 Week 6
Page 29: CS155 Week 6

…While now, we will play in sequence the 24 first harmonics of A2, i.e. a succession of sinusoids each of frequency 220 times k, where k is the partial number, from 1 till 24:

Page 30: CS155 Week 6
Page 31: CS155 Week 6

What is important to notice here is how, from the auditory sense, the steps in height seem huge at the beginning (e.g. first step is an octave, the second is a fifth, the third is a fourth…), while they seem to become finer and finer as we go up the series (e.g. the last step is lesser than a semitone).

But what we see on the previous spectrogram does not correspond to what we hear: there, we can see that all the steps are equal. On the other hand, if you look back at the spectrogram of the semitone scale, you will see that the steps increase exponentially, while on an auditory level, we perceive equal jumps in height.

Page 32: CS155 Week 6

With band-pass filter bandwidths, the situation is the same: a bandwidth of, say, 50Hz, will seem huge at a center frequency of, say, 75Hz, as there it will cover an octave (spreading from 50 to 100Hz), while at a center frequency of 1,000Hz, it won’t even cover a semitone. This is where the Q comes in handy.

In fact, there even exists a formula which yields the Q of a filter for a given musical interval:

… where R is the ratio corresponding to your interval. For example, substitute in that formula the interval ratio of an octave 2/1, and you’ll get

Or we can try it with the interval ratio of a major second, 9/8, yielding

1

1

2

1

R

RQ

5.12

3

12

12

2

1

Q

5.81

17

2

1

189

189

2

1

Q

Page 33: CS155 Week 6

As you can see, the tinier the interval ratio we specify, the greater the Q value we get, as shows the figure below:

In fact, the Q for an interval of 1 is infinite; anyway, an interval ratio of 1 is not really an interval. For example, from A3, 440Hz, to A3 times 1, there is 0Hz difference, and thus no interval at all.

Page 34: CS155 Week 6

We’ve seen in this lecture a brief definition of filtering and equalizing, as well as their basic vocabulary and concepts. We’ve seen how filtering affects incoming signals, both in terms of spectrum and waveform. We’ve been introduced to the ideas of decibels and Q-value, which you will meet frequently elsewhere as well. Now you have the knowledge you need to handle filters and bigger equalizers intelligently.