24 views

Uploaded by Raj Venugopal

Matlab

- Sound System Equalization
- User Guide
- Audio Enhancer
- All About Bass Compressor
- asdsad
- Presonus Studio Live 1602 Manual En
- Equalisation
- andivax subtitles
- Req
- Kick-Drum Processing Tips
- Profiler Midi Parameter Documentation
- Sound System Equalization
- Eng Pacemaker Manual 2.0
- xrd7120b.pdf
- resonator
- 04aLab4_Amadeus.pdf
- 04aLab4_Audition.pdf
- Release_Notes.pdf
- F6
- Wave Arts Manual

You are on page 1of 11

Table of Contents

Some Basic Designs ............................................................................................................ 1

Designs Based on Quality Factor ........................................................................................... 2

Low Shelf and High Shelf Filters .......................................................................................... 4

A Parametric Equalizer That Cuts .......................................................................................... 5

Cascading Parametric Equalizers ............................................................................................ 6

Advanced Design Options: Specifying Low and High Frequencies ............................................... 7

Shelving Filters with a Variable Transition Bandwidth or Slope .................................................. 8

Shelving Filters with a Prescribed Quality Factor .................................................................... 10

This example shows how to design parametric equalizer filters. Parametric equalizers are digital filters used in audio for

adjusting the frequency content of a sound signal. Parametric equalizers provide capabilities beyond those of graphic

equalizers by allowing the adjustment of gain, center frequency, and bandwidth of each filter. In contrast, graphic

equalizers only allow for the adjustment of the gain of each filter.

Typically, parametric equalizers are designed as second-order IIR filters. These filters have the drawback that because

of their low order, they can present relatively large ripple or transition regions and may overlap with each other when

several of them are connected in cascade. The DSP System Toolbox provides the capability to design high-order IIR

parametric equalizers. Such high-order designs provide much more control over the shape of each filter. In addition,

the designs special-case to traditional second-order parametric equalizers if the order of the filter is set to two.

This example discusses two separate approaches to parametric equalizer design. The first is using 'iirparameq' and the

second is using 'fdesign.parameq'. 'iirparameq' should serve most needs. It is simpler and provides the ability for most

common designs. It also supports C code generation which is needed if there is a desire to tune the filter at run-time

with generated code. 'fdesign.parameq' provides many advanced design options for ultimate control of the resulting

filter. Not all design options are explored in this example.

Consider the following two designs of parametric equalizers. The design specifications are the same except

for the filter order. The first design is a typical second-order parametric equalizer that boosts the signal

around 10 kHz by 5 dB. The second design does the same with a sixth-order filter. Notice how the sixthorder filter is closer to an ideal brickwall filter when compared to the second-order design. Obviously

the approximation can be improved by increasing the filter order even further. The price to pay for such

improved approximation is increased implementation cost as more multipliers are required.

Fs = 48e3;

N1 = 2;

N2 = 6;

G = 5; % 5 dB

Wo = 10000/(Fs/2);

BW = 4000/(Fs/2);

[SOS1,SV1] = iirparameq(N1,G,Wo,BW);

[SOS2,SV2] = iirparameq(N2,G,Wo,BW);

BQ1 = dsp.BiquadFilter('SOSMatrix',SOS1,'ScaleValues',SV1);

BQ2 = dsp.BiquadFilter('SOSMatrix',SOS2,'ScaleValues',SV2);

hfvt = fvtool(BQ1,BQ2,'Fs',Fs,'Color','white');

One of the design parameters is the filter bandwidth, BW. In the previous example, the bandwidth was

specified as 4 kHz. The 4 kHz bandwidth occurs at the point the two filters intersect (roughly 3.18 dB).

In general, the bandwidth is met at the arithmetic mean between the squared magnitude of the gain of the

filter and one. This value can be computed analytically as follows

Gsq = 10.^(G/10); % Magnitude squared of filter; G = 5 dB

GBW = 10*log10((Gsq + 1)/2) % 3.183 dB

GBW =

3.1830

Another common design parameter is the quality factor, Q. The Q of the filter is defined as Wo/BW

(center frequency/bandwidth). It provides a measure of the sharpness of the filter, i.e., how sharply the

filter transitions between the reference value (0 dB) and the gain G. Consider two designs with same G

and Wo, but different Q values.

Fs = 48e3;

N

= 2;

Q1 = 1.5;

Q2 = 10;

G

= 15; % 15 dB

Wo = 6000/(Fs/2);

BW1 = Wo/Q1;

BW2 = Wo/Q2;

[SOS1,SV1] = iirparameq(N,G,Wo,BW1);

[SOS2,SV2] = iirparameq(N,G,Wo,BW2);

BQ1 = dsp.BiquadFilter('SOSMatrix',SOS1,'ScaleValues',SV1);

BQ2 = dsp.BiquadFilter('SOSMatrix',SOS2,'ScaleValues',SV2);

hfvt = fvtool(BQ1,BQ2,'Fs',Fs,'Color','white');

legend(hfvt,'Q = 1.5','Q = 10');

Although a higher Q factor corresponds to a sharper filter, it must also be noted that for a given bandwidth,

the Q factor increases simply by increasing the center frequency. This might seem unintuitive. For example,

the following two filters have the same Q factor, but one clearly occupies a larger bandwidth than the other.

Fs = 48e3;

N

= 2;

Q

= 10;

G

= 9; % 9 dB

Wo1 = 2000/(Fs/2);

Wo2 = 12000/(Fs/2);

BW1 = Wo1/Q; % Bandwidth occurs at 6.5 dB in this case

BW2 = Wo2/Q; % Bandwidth occurs at 6.5 dB in this case

[SOS1,SV1] = iirparameq(N,G,Wo1,BW1);

[SOS2,SV2] = iirparameq(N,G,Wo2,BW2);

BQ1 = dsp.BiquadFilter('SOSMatrix',SOS1,'ScaleValues',SV1);

BQ2 = dsp.BiquadFilter('SOSMatrix',SOS2,'ScaleValues',SV2);

hfvt = fvtool(BQ1,BQ2,'Fs',Fs,'Color','white');

legend(hfvt,'BW1 = 200 Hz; Q = 10','BW2 = 1200 Hz; Q = 10');

When viewed on a log-frequency scale though, the "octave bandwidth" of the two filters is the same (about

0.1 octaves in this example).

hfvt = fvtool(BQ1,BQ2,'FrequencyScale','log','Fs',Fs,'Color','white');

The filter's bandwidth BW is only perfectly centered around the center frequency Wo when such frequency

is set to 0.5*pi (half the Nyquist rate). When Wo is closer to 0 or to pi, there is a warping effect that makes

a larger portion of the bandwidth to occur at one side of the center frequency. In the edge cases, if the

center frequency is set to 0 (pi), the entire bandwidth of the filter occurs to the right (left) of the center

frequency. The result is a so-called shelving low (high) filter.

Fs = 48e3;

N

= 4;

G

= 10; % 10 dB

Wo1 = 0;

Wo2 = 1; % Corresponds to Fs/2 (Hz) or pi (rad/sample)

BW = 1000/(Fs/2); % Bandwidth occurs at 7.4 dB in this case

[SOS1,SV1] = iirparameq(N,G,Wo1,BW);

[SOS2,SV2] = iirparameq(N,G,Wo2,BW);

BQ1 = dsp.BiquadFilter('SOSMatrix',SOS1,'ScaleValues',SV1);

BQ2 = dsp.BiquadFilter('SOSMatrix',SOS2,'ScaleValues',SV2);

hfvt = fvtool(BQ1,BQ2,'Fs',Fs,'Color','white');

legend(hfvt,'Low Shelf Filter','High Shelf Filter');

All previous designs are examples of a parametric equalizer that boosts the signal over a certain frequency

band. You can also design equalizers that cut (attenuate) the signal in a given region.

Fs = 48e3;

N = 2;

G = -5; % -5 dB

Wo = 6000/(Fs/2);

BW = 2000/(Fs/2);

[SOS,SV] = iirparameq(N,G,Wo,BW);

BQ = dsp.BiquadFilter('SOSMatrix',SOS,'ScaleValues',SV);

hfvt = fvtool(BQ,'Fs',Fs,'Color','white');

legend(hfvt,'G = -5 dB');

At the limit, the filter can be designed to have a gain of zero (-Inf dB) at the frequency specified. This

allows to design 2nd order or higher order notch filters.

Fs = 44.1e3;

N

= 8;

G

= -inf;

Q

= 1.8;

Wo = 60/(Fs/2); % Notch at 60 Hz

BW = Wo/Q; % Bandwidth will occur at -3 dB for this special case

[SOS1,SV1] = iirparameq(N,G,Wo,BW);

[NUM,DEN] = iirnotch(Wo,BW); % or [SOS2,SV2] = iirparameq(2,G,Wo,BW);

SOS2 = [NUM,DEN];

BQ1 = dsp.BiquadFilter('SOSMatrix',SOS1,'ScaleValues',SV1);

BQ2 = dsp.BiquadFilter('SOSMatrix',SOS2);

hfvt = fvtool(BQ1,BQ2,'Fs',Fs,'FrequencyScale','Log','Color','white');

legend(hfvt,'8th order notch filter','2nd order notch filter');

Parametric equalizers are usually connected in cascade (in series) so that several are used simultaneously

to equalize an audio signal. To connect several equalizers in this way, use the dsp.FilterCascade.

Fs = 48e3;

N

= 2;

G1 = 3; % 3 dB

G2 = -2; % -2 dB

Wo1 = 400/(Fs/2);

Wo2 = 1000/(Fs/2);

BW = 500/(Fs/2); % Bandwidth occurs at 7.4 dB in this case

[SOS1,SV1] = iirparameq(N,G1,Wo1,BW);

[SOS2,SV2] = iirparameq(N,G2,Wo2,BW);

BQ1 = dsp.BiquadFilter('SOSMatrix',SOS1,'ScaleValues',SV1);

BQ2 = dsp.BiquadFilter('SOSMatrix',SOS2,'ScaleValues',SV2);

FC = dsp.FilterCascade(BQ1,BQ2);

hfvt = fvtool(FC,'Fs',Fs,'Color','white','FrequencyScale','Log');

legend(hfvt,'Cascade of 2nd order filters');

Low-order designs such as the second-order filters above can interfere with each other if their center

frequencies are closely spaced. In the example above, the filter centered at 1 kHz was supposed to have a

gain of -2 dB. Due to the interference from the other filter, the actual gain is more like -1 dB. Higher-order

designs are less prone to such interference.

Fs = 48e3;

N

= 8;

G1 = 3; % 3 dB

G2 = -2; % -2 dB

Wo1 = 400/(Fs/2);

Wo2 = 1000/(Fs/2);

BW = 500/(Fs/2); % Bandwidth occurs at 7.4 dB in this case

[SOS1,SV1] = iirparameq(N,G1,Wo1,BW);

[SOS2,SV2] = iirparameq(N,G2,Wo2,BW);

BQ1a = dsp.BiquadFilter('SOSMatrix',SOS1,'ScaleValues',SV1);

BQ2a = dsp.BiquadFilter('SOSMatrix',SOS2,'ScaleValues',SV2);

FC2 = dsp.FilterCascade(BQ1a,BQ2a);

hfvt = fvtool(FC,FC2,'Fs',Fs,'Color','white','FrequencyScale','Log');

legend(hfvt,'Cascade of 2nd order filters','Cascade of 8th order

filters');

High Frequencies

For more advanced designs, fdesign.parameq can be used. For example, because of frequency warping, in general it can be difficult to control the exact frequency edges at which the bandwidth occurs. To

do so, the following can be used:

Fs

N

Flow

Fhigh

Grsq

Gref

G

Gsq

GBW

=

=

=

=

=

=

=

=

=

44.1e3;

4;

3000;

4000;

1;

10*log10(Grsq);

-8;

10.^(G/10); % Magnitude squared of filter; G = 5 dB

10*log10((Gsq + Grsq)/2); % Flow and Fhigh occur at -2.37 dB

PEQ = fdesign.parameq('N,Flow,Fhigh,Gref,G0,GBW',...

N,Flow/(Fs/2),Fhigh/(Fs/2),Gref,G,GBW);

BQ = design(PEQ,'SystemObject',true);

hfvt = fvtool(BQ,'Fs',Fs,'Color','white');

legend(hfvt,'Equalizer with Flow = 3 kHz and Fhigh = 4 kHz');

Notice that the filter has a gain of -2.37 dB at 3 kHz and 4 kHz as specified.

Bandwidth or Slope

One of the characteristics of a shelving filter is the transition bandwidth (sometimes also called transition

slope) which may be specified by a shelf slope parameter S. The bandwidth reference gain GBW is always

set to half the boost or cut gain of the shelving filter. All other parameters being constant, as S increases

the transition bandwidth decreases, (and the slope of the response increases) creating a "slope rotation"

around the GBW point as illustrated in the example below.

N = 2;

Fs = 48e3;

Fo = 0; % F0=0 designs a lowpass filter, F0=1 designs a highpass

filter

Fc = 2e3/(Fs/2); % Cutoff Frequency

G = 10;

S = 1.5;

PEQ = fdesign.parameq('N,F0,Fc,S,G0',N,Fo,Fc,S,G);

BQ1 = design(PEQ,'SystemObject',true);

PEQ.S = 2.5;

BQ2 = design(PEQ,'SystemObject',true);

PEQ.S = 4;

BQ3 = design(PEQ,'SystemObject',true);

hfvt = fvtool(BQ1,BQ2,BQ3,'Fs',Fs,'Color','white');

legend(hfvt,'S=1.5','S=2.5','S=4');

The transition bandwidth and the bandwidth gain corresponding to each value of S can be obtained using

the measure function. We verify that the bandwidth reference gain GBW is the same for the three designs

and we quantify by how much the transition width decreases when S increases.

m1 = measure(BQ1);

get(m1,'GBW')

m2 = measure(BQ2);

get(m2,'GBW')

m3 = measure(BQ3);

get(m3,'GBW')

ans =

5

ans =

5

ans =

5

get(m1,'HighTransitionWidth')

get(m2,'HighTransitionWidth')

get(m3,'HighTransitionWidth')

ans =

0.0945

ans =

0.0425

ans =

0.0238

As the shelf slope parameter S increases, the ripple of the filters also increases. We can increase the filter

order to reduce the ripple while maintaining the desired transition bandwidth.

N

= 2;

PEQ = fdesign.parameq('N,F0,Fc,S,G0',N,Fo,Fc,S,G);

BQ1 = design(PEQ,'SystemObject',true);

PEQ.FilterOrder = 3;

BQ2 = design(PEQ,'SystemObject',true);

PEQ.FilterOrder = 4;

BQ3 = design(PEQ,'SystemObject',true);

hfvt = fvtool(BQ1,BQ2,BQ3,'Fs',Fs,'Color','white');

legend(hfvt,'N=2','N=3','N=4');

The quality factor Qa may be used instead of the shelf slope parameter S to design shelving filters with

variable transition bandwidths.

N = 2;

Fs = 48e3;

Fo = 1; % F0=0 designs a lowpass filter, F0=1 designs a highpass

filter

Fc = 20e3/(Fs/2); % Cutoff Frequency

G = 10;

Q = 0.48;

10

PEQ = fdesign.parameq('N,F0,Fc,Qa,G0',N,Fo,Fc,Q,G);

BQ1 = design(PEQ,'SystemObject',true);

PEQ.Qa = 1/sqrt(2);

BQ2 = design(PEQ,'SystemObject',true);

PEQ.Qa = 2.0222;

BQ3 = design(PEQ,'SystemObject',true);

hfvt = fvtool(BQ1,BQ2,BQ3,'Fs',Fs,'Color','white');

legend(hfvt,'Qa=0.48','Qa=0.7071','Qa=2.0222');

Published with MATLAB R2015a

11

- Sound System EqualizationUploaded bydavorko_t
- User GuideUploaded bybidyut_iitkgp
- Audio EnhancerUploaded bythriller456
- All About Bass CompressorUploaded byihpeter
- asdsadUploaded bynathanxdd
- Presonus Studio Live 1602 Manual EnUploaded byg3124
- EqualisationUploaded bysarantapodarusa4009
- andivax subtitlesUploaded byblizniak9
- ReqUploaded byJesús Tadeo Zambrano Vernay
- Kick-Drum Processing TipsUploaded byrabbs7890_1
- Profiler Midi Parameter DocumentationUploaded byAndrea Talarico
- Sound System EqualizationUploaded byEspartaco Valdez
- Eng Pacemaker Manual 2.0Uploaded bym5a6ab
- xrd7120b.pdfUploaded byBertoni Sahuleka Mandau
- resonatorUploaded byjohnjabaraj
- 04aLab4_Amadeus.pdfUploaded byWalid_Sassi_Tun
- 04aLab4_Audition.pdfUploaded byWalid_Sassi_Tun
- Release_Notes.pdfUploaded byIoannis Amanatidis
- F6Uploaded by石哲安
- Wave Arts ManualUploaded byClaudia Marques Ferreira
- EQ TipsUploaded bysalecello2113
- CompareUploaded byyasir2306
- DX2datasheetUploaded byAgin Tersakiti
- Waves F6 ManualUploaded byWalterCruz74783
- Dp-II Series Um en v1.0Uploaded byhanspkt
- Logic Tech 0311Uploaded byGeorge Damian-Filip
- asUploaded byفیضان حنیف
- P16-M_P0421_S_ENUploaded byJadson Menezes
- Spgram TutUploaded bySudhir Rawat
- Code No: 27161Uploaded bySRINIVASA RAO GANTA

- 64 Interview QuestionsUploaded byshivakumar N
- Page 33Uploaded byRaj Venugopal
- Kamba Ramayanam Page 25Uploaded byRaj Venugopal
- Kamba Ramayanam Page 21Uploaded byRaj Venugopal
- Ivory TowersUploaded bysilversatrapi
- Kamba Ramayanam Page 17Uploaded byRaj Venugopal
- Kamba Ramayanam Page 13Uploaded byRaj Venugopal
- Page 9.pdfUploaded byRaj Venugopal
- Kamba Ramayanam Page 1Uploaded byRaj Venugopal
- Page 5.pdfUploaded byRaj Venugopal
- Kamba RamayanamUploaded byRaj Venugopal
- 001-Valmiki-Ramayan-in-Tamil-Part-1.pdfUploaded byRaj Venugopal
- Tasm ManualUploaded byRaj Venugopal
- Chettinad ChickenUploaded byRaj Venugopal
- Chris Christie’s wordless screaming - The Washington Post.pdfUploaded byRaj Venugopal
- Vcl Unicode MigrationUploaded byRaj Venugopal
- Cbuilder Feature MatrixUploaded bytimmyJackson
- Complex Numbers _ Mathematics of the DFTUploaded byRaj Venugopal
- Sampling TheoryUploaded byAtabat Adudu
- ShaderX_ImageProcessingUploaded byRaj Venugopal
- Eece 522 Notes_06 Ch_3cUploaded bykarim2005
- Levelling and LoundnessUploaded byRaj Venugopal
- How Digital Filters Affect Analog Audio Signal Levels TI Slyt375Uploaded byRaj Venugopal
- Ashtavakra Gita eBookUploaded byHarshad Ashodiya Interior Designer
- Eece 522 Notes_30 Ch_13bUploaded bykarim2005
- Understanding the Basis of the Kalman FilterUploaded byAnonymous
- TheFundamentalConflictsBetweenIslamAndQadiyaniyatByShaykhMuhammadIdreesKandhelvir.AUploaded byMMShakir
- Quran 17-114 by PalmerUploaded byRaj Venugopal

- Business MathUploaded byJanrey Oriña Navalta
- Data structures and algorithms to support interactive spatial analysis using dynamic Voronoi diagUploaded byLuz Nidia Gómez Luna
- 06 Spring Lecture Notes 7Uploaded bySanel Grabovica
- paper_172_RUploaded byAshutosh Pandey
- preaseason maitenance tromboneUploaded byapi-425394984
- TTB+FAQ+(10-4-17)+(1).pdfUploaded byTanakrite Thantawanich
- Standardization of ProtocolUploaded byAbhinav Tewari
- E-501S Data SheetUploaded byYoga Firmansyah
- CMW-Z10_bro_enUploaded byVaibhav Sharma
- Combat & Survival - September 2015 UKUploaded bycuco777
- Africa Environment Outlook 3 - Authors guideUploaded byUnited Nations Environment Programme
- Vocational Training ITI Ltd., 16-06-2008 to 14-07-2008Uploaded bySaurabh Chatterjee
- 8BL45GB - ManualUploaded byJorge Chapi
- 235, Tensile Characteristics of Individual Fibres - Methods fUploaded bycswamidei1
- Native American RecipesUploaded bygeomonster
- NFPA AFCI Fact SheetUploaded byFlorabel Tolentino Sera Josef
- 917370921 Owners ManualUploaded byisaac_maykovich
- jurnal pendukung konasUploaded byrosa
- SelfUploaded bycayla mae carlos
- 1d Vacuum Toilet Sys Evac 125Uploaded bySham
- CP5 PressureUploaded byMohd Iqbal
- itsyllabus2010 (1)Uploaded byDennis Danial
- Defining Terms & PrincipalUploaded byMahade Hasan Dipu
- Orgo II Lab 4Uploaded byPhillip Wachowiak
- flowerarrangements-140412023317-phpapp01Uploaded byArushi Chadha
- IEEE C57-13 (Instrument Transformers)Uploaded byVICTOR JOSE VILORIA
- (Springer Series in Statistics) R.-D. Reiss (auth.)-Approximate Distributions of Order Statistics_ With Applications to Nonparametric Statistics-Springer-Verlag New York (1989).pdfUploaded byNicko Villar
- M062 Code of Practice Storage of Hazardous SubstancesUploaded byYanka Ilarionova
- Fudge the ASCB SystemUploaded bydbowes_5
- englez - roman.txtUploaded bygerte_yuew