Coder Social home page Coder Social logo

dsp_fall_2022_kaist's Introduction

DSP_Fall_2020_KAIST

This file is for KAIST students who are taking Digital Signal Processing (EE432), especially regarding filter design using MATLAB.


Filter Design Basics

0. 기본기 - 들어가기 앞서

0.1 MATLAB functions

Matlab 에서는 임의의 n개의 변수를 받아 임의의 k개의 변수를 창출해내는 행위가 가능하다. 사용법은 간단하고 대부분 다음과 같다.


[n, Wc] = cheb1ord(Wp, Ws, atp, ats, 's'); %Find order(n) and cutoff freq(Wc)


Filter Design Functions Descriptions

Optimizing / Prototypes

Cheby1ord

cheby1

cheb2ord

cheby2

buttord

butter

ellipord

elllip

Transformation

bilinear

impinvar

tf2zp

lp2lp

System Function Representation

tf

Anothertf

zpk

Windowing

rectwin

impz

fir1

designfilt

Note: 둘 사이 변환을 위한 함수는 다음과 같이 사용한다.


tf2zp(b, a); % Transfer function to Zero Pole K(constant)

zp2tf(bz, az, k); % Zero Pole K(constant) to Transfer function 


0.2 Tools


zplane(bz, az); % Z-plane 그릴 때

freqs(b, a) % System function이 s 에 대한 함수일 경우 == Transfer function

freqz(bz, az) % System function이 z에 대한 함수일 경우

fvtool(bz, az); % System 의 frequency response 분석 도구


0.3 ???


1. Impulse Invariance Method

1.1 Normalization of bands

먼저, Passband과 Stopband 두 경계선을 Td, 즉 sampling interval 로 나누어 주는 Band Normalization을 진행한다.


Wp = wp / Td; % Pass Band

Ws = ws / Td; % Stop Band 

1.2 Find analog filter prototype

다음으로 Matlab 에 내재되어 있는 함수를 이용하여, 필터의 조건을 충족시키는 최적의 N(order) 값과 Wc(Cutoff Frequency) 값을 구해낸다.


[n, Wc] = cheb1ord(Wp, Ws, atp, ats, 's');

이후, system function 꼴로 나타내어준다. (Frequency response)


[b, a] = cheby1(n, atp, Wc, 's');

1.3 Cutting the edge

필터 설계시, 1.2 단계에서 구한 cutoff frequency, Wc 에 맞추어, system function 을 알맞게 추려낸다.


[bt, at] = lp2lp(b, a, Wc);

달리 말해, 아날로그 필터에 맞추어 Wp(pass band)와 Ws(stop band) 등을 조정해주는 기능이다.

1.4 Transformation

Matlab에 내재된 impinvar(systemVar1, systemVar2, fs) 함수를 이용하여, z transform 의 꼴로 변환된 "new system function"을 얻도록 하자.


[bz, az] = impinvar(bt, at, 1/Td);


2. Bilinear Method

2.1 Transformation of variables

Laplace transform의 s plane 으로부터 Z transform 의 z plane 으로 옮겨오는 과정이다. S-plane 의 y축, 즉 허수 부분은 Z-plane 의 unit circle 에 해당함을 기억하자. 변환식은 다음과 같다.


Wp = 2/Td * tan(wp/2);

Ws = 2/Td * tan(ws/2);

2.2 Find analog filter prototype

다음으로 Matlab 에 내재되어 있는 함수를 이용하여, 필터의 조건을 충족시키는 최적의 N(order) 값과 Wc(Cutoff Frequency) 값을 구해낸다.


[n, Wc] = cheb1ord(Wp, Ws, atp, ats, 's');

이후, system function 꼴로 나타내어준다. (Frequency response)


[b, a] = cheby1(n, atp, Wc, 's');

2.3 Cutting the edge

필터 설계시, 1.2 단계에서 구한 cutoff frequency, Wc 에 맞추어, system function 을 알맞게 추려낸다.


[bt, at] = lp2lp(b, a, Wc);

달리 말해, 아날로그 필터에 맞추어 Wp(pass band)와 Ws(stop band) 등을 조정해주는 기능이다.

2.4 Transformation

Matlab에 내재된 bilinear(systemVar1, systemVar2, fs) 함수를 이용하여, z transform 의 꼴로 변환된 "new system function"을 얻도록 하자.


[bz, az] = impinvar(bt, at, 1/Td);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.