Você está na página 1de 10

ASSIGNMENT TOPIC:

TO CALCULATE EXTREMAL FREQUENCIES BY USING


REMEZ EXCHANGE ALGORITHM

COURSE TITLE: ADVANCED DIGITAL SIGNAL PROCESSING


COURSE CODE: VL 7101

SUBMITTED BY:
SARFRAZ HUSSAIN (MT/12/VLSI/01)
CHANDNI PANDEY (MT/12/VLSI/02)
PURNIMA KUMARI SHARMA (MT/12/VLSI/03)
NIKHIL DEO (MT/12/VLSI/04)
KAMAL JYOTI PATHAK (MT/12/VLSI/05)

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING


NORTH EASTERN REGIONAL INSTITUTE OF SCIENCE AND TECHNOLOGY
( DEEMED UNIVERSITY ) NIRJULI::: ARUNACHAL PRADESH:::791109

REMEZ EXCHANGE ALGORITHM


1. Guess the position of the M/2 + 2 maximal error frequencies and give alternating sign
to errors (e.g choose evenly spaced W).
2. Determine the error magnitude , and the M/2 coefficient of the polynomials that
passes through the maximal error location.
3. Find the local maxima of the error function by evaluating e() = w() (H()-d()) on
dense set of .
4. Update the maximal error frequencies to be an alternating subset of the local edges +
band edges + {0 and/or }.
If maximal error is >, go back to step 2(typically 15 iterations)
5. Evaluate H() on M+1 evenly spaced and do an IDFT to get h(n)/w(n).

CHEBYSHEV POLYNOMIAL
M

Impulse response:

H()=H(ej )=h(0)+2 12 h(n)cos(n)

But cosn = Tn (cos ): chebyshev polynomial of 1st kind


Cos2 =2cos2 -1=T2 (cos )
Recurrence relation:
Tn+1(x) = 2x Tn(x) Tn-1 (x) with T0(x) = 1, T1(x) = x

Q) A linear phase bandpass filter is required to meet the following specifications:


Passband
Passband ripple
Stopband attenuation
Sampling frequency
Transition frequency

900-1100 Hz
<0.87 dB
>30 dB
15 kHz
450 Hz

Use the optimal method to obtain suitable coefficients. Plot the filter spectrum.
Solution:
From the specifications, the filter has three bands: a lower stopband (0 to 450 Hz), a
passband (900 to 1100 Hz), and an upper stopband (1550 to 7500 Hz). To use the optimal
design program the band edge frequencies must be normalized, that is expressed as fractions
of the sampling frequency:
450

450/15000 = 0.03

900

900/15000 = 0.06

1100

1100/15000 = 0.0733

1550

1550/15000 = 0.1033

7500

7500/15000 = 0.5

The weights are dependent on the passband and stopband deviations. The deviations, in
ordinary units, can be obtained from the given passband ripple and stopband attenuation:
0.87 dB ripple: 20 log (1 + P)
30 dB: -20 log (s)

P = 0.10535
s = 0.031623

Filter length, N = 41
Type of Filter, Jtype = 1
No. of bands, numband = 3
Weights, W () = 10, 3, 10
Grid density, Ngrid = 32
r = of the number of filter coefficients = 21
Edge frequencies = 0, 0.03, 0.06, 0.0733, 0.1033, 0.5
To calculate the Extremal frequencies and Impulse response we use REMEZ EXCHANGE
ALGORITHM.
Desired response will have zeros in the stop band and ones in the passband

Delf = 0.5/(GRIDDENSITY * r); Grid(0) = 0; Grid(1) = delf + delf; and so on. Here delf is
the difference between the two grid points.
f = 0.5 / (ngrid x r);
Delf = 7.1 * 10 4 ; Grid size = 620
Grid (0-619)
0

0.0007

0.0014

0.0021

0.0028

0.0036

0.0043

0.0050

0.0057

0.0064

0.0071

0.0078

0.0085

0.0092

0.0099

0.0107

0.0114

0.0121

0.0128

0.0135

0.0142

0.0149

0.0156

0.0163

0.0170

0.0178

0.0185

0.0192

0.0199

0.0206

0.0213

0.0220

0.0227

0.0234

0.0241

0.0248

0.0256

0.0263

0.0270

0.0277

0.0284

0.0300

0.0600

0.0607

0.0614

0.0621

0.0628

0.0636

0.0643

0.0650

0.0657

0.0664

0.0671

0.0678

0.0685

0.0692

0.0699

0.0707

0.0714

0.0721

0.0733

0.1033

0.1040

0.1047

0.1054

0.1061

0.1069

0.1076

0.1083

0.1090

0.1097

0.1104

0.1111

0.1118

0.1125

0.1132

0.1140

0.1147

0.1154

0.1161

0.1168

0.1175

0.1182

0.1189

0.1196

0.1203

0.1211

0.1218

0.1225

0.1232

0.1239

0.1246

0.1253

0.1260

0.1267

0.1274

0.1282

0.1289

0.1296

0.1303

0.1310

0.1317

0.1324

0.1331

0.1338

0.1345

0.1352

0.1360

0.1367

0.1374

0.1381

0.1388

0.1395

0.1402

0.1409

0.1416

0.1423

0.1431

0.1438

0.1445

0.1452

0.1459

0.1466

0.1473

0.1480

0.1487

0.1494

0.1502

0.1509

0.1516

0.1523

0.1530

0.1537

0.1544

0.1551

0.1558

0.1565

0.1573

0.1580

0.1587

0.1594

0.1601

0.1608

0.1615

0.1622

0.1629

0.1636

0.1644

0.1651

0.1658

0.1665

0.1672

0.1679

0.1686

0.1693

0.1700

0.1707

0.1715

0.1722

0.1729

0.1736

0.1743

0.1750

0.1757

0.1764

0.1771

0.1778

0.1786

0.1793

0.1800

0.1807

0.1814

0.1821

0.1828

0.1835

0.1842

0.1849

0.1857

0.1864

0.1871

0.1878

0.1885

0.1892

0.1899

0.1906

0.1913

0.1920

0.1928

0.1935

0.1942

0.1949

0.1956

0.1963

0.1970

0.1977

0.1984

0.1991

0.1999

0.2006

0.2013

0.2020

0.2027

0.2034

0.2041

0.2048

0.2055

0.2062

0.2070

0.2077

0.2084

0.2091

0.2098

0.2105

0.2112

0.2119

0.2126

0.2133

0.2141

0.2148

0.2155

0.2162

0.2169

0.2176

0.2183

0.2190

0.2197

0.2204

0.2212

0.2219

0.2226

0.2233

0.2240

0.2247

0.2254

0.2261

0.2268

0.2275

0.2283

0.2290

0.2297

0.2304

0.2311

0.2318

0.2325

0.2332

0.2339

0.2346

0.2354

0.2361

0.2368

0.2375

0.2382

0.2389

0.2396

0.2403

0.2410

0.2417

0.2425

0.2432

0.2439

0.2446

0.2453

0.2460

0.2467

0.2474

0.2481

0.2488

0.2496

0.2503

0.2510

0.2517

0.2524

0.2531

0.2538

0.2545

0.2552

0.2559

0.2567

0.2574

0.2581

0.2588

0.2595

0.2602

0.2609

0.2616

0.2623

0.2630

0.2638

0.2645

0.2652

0.2659

0.2666

0.2673

0.2680

0.2687

0.2694

0.2701

0.2709

0.2716

0.2723

0.2730

0.2737

0.2744

0.2751

0.2758

0.2765

0.2772

0.2780

0.2787

0.2794

0.2801

0.2808

0.2815

0.2822

0.2829

0.2836

0.2843

0.2851

0.2858

0.2865

0.2872

0.2879

0.2886

0.2893

0.2900

0.2907

0.2914

0.2922

0.2929

0.2936

0.2943

0.2950

0.2957

0.2964

0.2971

0.2978

0.2985

0.2993

0.3000

0.3007

0.3014

0.3021

0.3028

0.3035

0.3042

0.3049

0.3056

0.3064

0.3071

0.3078

0.3085

0.3092

0.3099

0.3106

0.3113

0.3120

0.3127

0.3135

0.3142

0.3149

0.3156

0.3163

0.3170

0.3177

0.3184

0.3191

0.3198

0.3206

0.3213

0.3220

0.3227

0.3234

0.3241

0.3248

0.3255

0.3262

0.3269

0.3277

0.3284

0.3291

0.3298

0.3305

0.3312

0.3319

0.3326

0.3333

0.3340

0.3348

0.3355

0.3362

0.3369

0.3376

0.3383

0.3390

0.3397

0.3404

0.3411

0.3419

0.3426

0.3433

0.3440

0.3447

0.3454

0.3461

0.3468

0.3475

0.3482

0.3490

0.3497

0.3504

0.3511

0.3518

0.3525

0.3532

0.3539

0.3546

0.3553

0.3561

0.3568

0.3575

0.3582

0.3589

0.3596

0.3603

0.3610

0.3617

0.3624

0.3632

0.3639

0.3646

0.3653

0.3660

0.3667

0.3674

0.3681

0.3688

0.3695

0.3703

0.3710

0.3717

0.3724

0.3731

0.3738

0.3745

0.3752

0.3759

0.3766

0.3774

0.3781

0.3788

0.3795

0.3802

0.3809

0.3816

0.3823

0.3830

0.3837

0.3845

0.3852

0.3859

0.3866

0.3873

0.3880

0.3887

0.3894

0.3901

0.3908

0.3916

0.3923

0.3930

0.3937

0.3944

0.3951

0.3958

0.3965

0.3972

0.3979

0.3987

0.3994

0.4001

0.4008

0.4015

0.4022

0.4029

0.4036

0.4043

0.4050

0.4058

0.4065

0.4072

0.4079

0.4086

0.4093

0.4100

0.4107

0.4114

0.4121

0.4129

0.4136

0.4143

0.4150

0.4157

0.4164

0.4171

0.4178

0.4185

0.4192

0.4200

0.4207

0.4214

0.4221

0.4228

0.4235

0.4242

0.4249

0.4256

0.4263

0.4271

0.4278

0.4285

0.4292

0.4299

0.4306

0.4313

0.4320

0.4327

0.4334

0.4342

0.4349

0.4356

0.4363

0.4370

0.4377

0.4384

0.4391

0.4398

0.4405

0.4413

0.4420

0.4427

0.4434

0.4441

0.4448

0.4455

0.4462

0.4469

0.4476

0.4484

0.4491

0.4498

0.4505

0.4512

0.4519

0.4526

0.4533

0.4540

0.4547

0.4555

0.4562

0.4569

0.4576

0.4583

0.4590

0.4597

0.4604

0.4611

0.4618

0.4626

0.4633

0.4640

0.4647

0.4654

0.4661

0.4668

0.4675

0.4682

0.4689

0.4697

0.4704

0.4711

0.4718

0.4725

0.4732

0.4739

0.4746

0.4753

0.4760

0.4768

0.4775

0.4782

0.4789

0.4796

0.4803

0.4810

0.4817

0.4824

0.4831

0.4839

0.4846

0.4853

0.4860

0.4867

0.4874

0.4881

0.4888

0.4895

0.4902

0.4910

0.4917

0.4924

0.4931

0.4938

0.4945

0.4952

0.4959

0.4966

0.4973

0.4981

0.4988

0.5000

Ext (initial guess of extremal indexes) can be found by using the formula
Ext(i) = i x (size of the grid 1) / half the number of filter coefficients;
Ext[i] = i * (gridsize-1) / r; i is increased till i=r;

29

59

88

118

147

177

206

236

383

413

442

472

501

531

560

590

619

265

295

324

354

e() = w() (H() - d());

Error Calculation using the function:

where w() is the weight function, H() is impulse response, d() is desired response.
H() value is calculated from the chebyshev polynomial. Maxima is taken as +ve and
minima is
taken as ve.
New Extremal indexes after 1st iteration
21 42
339 369

52
398

61
428

62
457

99
487

130
517

160
546

190
576

220

250

280

309

244

275

307

338

182

213

245

276

New Extremal indexes after 2nd iteration


38

47

369 401

61

71

95

120

150

181

212

432

464

496

528

560

599

599

New Extremal indexes after 3rd iteration


38

39

47

61

62

72

96

121

151

308

339

370

402

433

465

497

529

561

Extremal frequencies after 1st iteration


0.0142

0.0300

0.0664

0.0733

0.1033

0.1296

0.1516

0.1729

0.1942

0.2155

0.2368

0.2581

0.2787

0.3000

0.3213

0.3419

0.3632

0.3837

0.4050

0.4263

0.4469

0.4682

Extremal frequencies after 2rd iteration


0.0263

0.0628

0.0733

0.1097

0.1267

0.1445

0.1658

0.1878

0.2098

0.2325

0.2545

0.2772

0.2993

0.3213

0.3440

0.3660

0.4342

0.4569

0.4846

0.4846

0.3887

0.4114

Extremal frequencies after 3rd iteration


0.0263

0.0270

0.0628

0.0733

0.1033

0.1104

0.1274

0.1452

0.1665

0.1885

0.2105

0.2332

0.2552

0.2780

0.3000

0.3220

0.3447

0.3667

0.3894

0.4121

0.4349

0.4576

Impulse response coefficients after 3rd iteration


0.0018

-0.0054

0.0089

-0.0124

0.0158

-0.0191

0.0223

-0.0254

0.0283

-0.0310

0.0336

-0.036

0.0382

-0.0401

0.0418

-0.0433

0.0445

-0.0454

0.0461

-0.0465

1.0031

MATLAB PROGRAM AND OUTPUT


Fs=15000;
ap=0.87;
as=30;
M=[0 1 0];
F=[450 900 1100 1550];
dp=(10^(ap/20)-1)/(10^(ap/20)+1);
ds=10^(-as/20);
dev=[ds dp ds];
[N,F0,M0,W] = firpmord(F,M,dev,Fs);
[b delta]=firpm(N,F0,M0,W);
[H,f]=freqz(b,1,1024,Fs);
mag=20*log10(abs(H));
f=f./Fs;
plot(f,mag),grid on;
xlabel('frequency(Hz)');
ylabel('magnitude(dB)');

Você também pode gostar