'DSP'에 해당되는 글 7건

  1. 2015.04.15 mason's formula 4
  2. 2015.04.03 convolution - C++ 구현
  3. 2015.03.26 rect func fourier transform
  4. 2015.03.23 causal vs noncausal
  5. 2015.03.16 fourier property
  6. 2015.03.16 Properties of Fourier Transform
  7. 2015.03.16 convolution 의미

mason's formula

DSP 2015. 4. 15. 23:32




반갑습니다. 위대한 교주 LGS입니다. (모두들 교주를 찬양합시다)

System을 표현 하는 방법중에는 Transfer function을  담고 있는 Block(네모난 상자)들을 서로 연결하여 

Graphical 하게 System을 표현하는 방법도 있습니다. 각 Block은 System을 이루는 각 부품을 표현하는 TF일꺼구요~ 

Block으로 이루어진 그림을 Block Diagram이라고 그래요.

오늘은 이 Transfer function Block을 가지고 놀아보죠~ ^^


TF0301.png


만약 Block diagram에서 Transfer function이 series(직렬)로 연결되어 있으면 ... 둘을 곱하면 됩니다.

Control System Toolbox에서 series라는 함수를 제공하고 있지만 (G = series(G1,G2) ) 굳이 series라는 함수를 사용하실 필요 없이

그냥 간단하게 G = G1 * G2 라고 하시면 됩니다.



TF0302.png


Transfer function이 parallel(병렬)로 연결되어 있으면 둘을 더하면 되구요

역시 Control System Toolbox에서 parallel이라는 함수를 제공하고 있지만(G = parallel(G1,G2) ) 그냥 G = G1 + G2 라고 하셔도 됩니다.

여기까지는 문제 없으시죠? ^^

자 다음 Feedback을 포함하고 있는 closed loop를 봅시다~


TF0303.png


E(s)는 실제 output Y(s)와 내가 원하는 값 X(s) 사이의 차이(Error)를 말합니다. 

그러므로 E(s) = X(s) - Y(s)가 될꺼구요 ( (-)가 붙은 것에 주의하세요~ )

Feedback 신호에 (-)마이너스가 붙은 녀석을 Negative Feedback이라고 합니다.

H(s)는 센서 같은 녀석의 transfer function이구요. (G(s)는 plant(실제 작동하는 녀석)의 TF겠죠?)

전체 Transfer function은 Y(s) = E(s)G(s) 와 E(s) = X(s) - E(s)G(s)H(s) 를 연립해서 푸시면 쉽게 구하실 수 있습니다. ^^

계산을 해보시면 feedback loop의 transfer function은 Geq(s) = G(s)/[1+H(s)G(s)] 가 되네요 

(Negative Feedback인 경우 Geq가 G(s)/[1+H(s)G(s)] 라는 정도는 외워두시면 편합니다.)

MATLAB에서 closed loop의 전체 transfer function을 계산하시려면 feedback이라는 함수를 사용하시면 되요~ =(=^ㅅ^=)=

G_eq = feedback(G,H)라고 하시면 equivalent transfer function을 얻으 실 수 있습니다.


예를 들어 G(s) = 1/(s+2) , H(s) = 1/(s+3) 이라고 한다면 TF는?? 넵~ 잘하셨습니다 ㅎㅎ

TF0304.png

TF0305.png


아주 간단한 녀석으로 연습 하나 더 해보고 가겠습니다. ^^

TF0313.png


간단하다고 한건 훼이크였구요 ;; (죄송) 조금만 복잡해져도 머리속이 복잡해집니다요 ㅜㅜ

위의 Block diagram을 다른 방법으로 표현해보겠습니다.

TF0306.png

위와 같이 생긴 그림을 Signal-flow graph라고 해요.

Block diagram에서 Signal-flow graph로 변경하는 것 척!봐도 아시겠죠? ^^ 

Node(신호가 쪼개지거나 합쳐지는 지점)만 잘 잡으시고 부호만 신경 써주시면 땡입니다요~ o(^o^)o


위의 복잡한 Signal Flow Chart(또는 Block Diagram)를 팍 뭉뚱그려서 한개의 Block으로 만드는 방법이 있습니다. 

이름하야 (Mason 아져씨가 만들었다 하여) Mason's Rule !! 두둥!!

Mason's Rule을 적용하시려면 우선 3가지를 구해 주셔야 합니다.

Forward-path gain, Loop gain, 그리고 마지막으로 Nontouching-loop gain !!


Forward-path gain 부터 보죠~

Forward-path gain은 말 그대로 input X(s)에서 output Y(s)로 가는 모든 길을 말합니다. 단 중간에 뒤로 돌아올 수 없습니다.

무조건 앞으로만 전진하여 X(s)에서 Y(s)로 가는 모든 길을 찾아주시면 됩니다.


TF0307.png


TF0308.png


위의 예제의 경우 Forward-path가 2개가 있네요~ 그러므로

TF0309.png

이 됩니다.

두번째로 Loop gain. 말그대로 빙글빙글 도는 Loop를 모두 찾아주세요. 화살표 방향 잘보시고요~


Correction01.png 

 

아 복잡하군요 ^^;;  각 Loop를 따로 그려보면 

Correction03.png


Loop gain을 정리해봅시다요. o(^o^)o

Correction02.png  


마지막으로 Loop들끼리 Nontouching-loop gain을 찾아주시면 끝~

1번 loop와 2번 loop는 서로 노터치 하고 있네요. 그리고 1번 loop와 3번 loop도 노터치이구요~

2번,3번은 서로 터치합니다. 그러니까 Nontouching-loop gain에서 제외!!

(지금의 예제에서는 없지만 만약 3개,4개, 등등...의 Loop가 서로 독립적이라면 모든 조합을 다 적어주세요~)


Correction04.png  


자~ 이제 위에서 구한 Forward-path gain, Loop gain, Nontouching-loop gain을 Mason 아져씨가 잘 정리해둔 Mason's Rule에 

대입하면 끝~  =(=^ㅅ^=)=


Correction05.png 

여기에서 Δ는  1 - (모든 Loop gain의 합) + (모든 2 Nontouching-loop gain의 합) - (모든 3 Nontouching-loop gain의 합) - (모든 4 .....) 입니다.

지금의 예에서는 2 Nontouching-loop gain 밖에 없네요 ^^

Pk는 K번째 Forward-path gain이구요~ Δk는 K번째 Forward-path gain와 노터치하는 Loop의 Δ를 계산해주시면 됩니다.

지금은 모든 Loop가 Forward path랑 다 접하고 있어 Δk는 모두 1입니다.


Mason's Rule을 하시다보면 아~ 귀찮아요 -_-;; 흑묘든 백묘든 쥐만 잘 잡으면 됩니디요~ 깜장 고양이든 흰둥이 고양이든... 냠 

훨씬 간단한 방법이 있습니다. 대단히 대단하고 엄청히 엄청난 여러분의 교주가

Simulink로 Block diagram을 그리고 Simulink model에서 바로 Transfer function을 뽑아내 보겠습니다. ^^ (Simulink의 간단한 사용법)

우선 Simulink로 보이는 대로 들리는 대로 상상하는 대로 사이버 Simulink Model 하나 만드시구요~ (기타로 오토바이 타자!!)


TF0315.png 


위의 System은 G(s) = 1/s고 H(s)는 1이니까 Geq(s) = 1/(s+1)로 암산으로도 계산 할 수 있으시죠? =(=^ㅅ^=)= 

우선 Constant와 node(동그라미 안에 +-있는 녀석) 사이의 선을 선택하신 후 마우스 오른쪽을 클릭 -> Linearization Points -> Input point를 클릭하여

Input point를 만듭니다.


TF0316.png

 

다음으로 Integrator(1/s)와 Scope 사이의 선을 선택하신 후 위와 같은 방법으로 Output point를 만들어 주세요~

그러면 Input point와 Output point를 확인 할 수 있는 표시가 생깁니다.


TF0317.png


다음으로 Menu의 Tools -> Control Design -> Linear Analysis ... 를 클릭하셔서...

TF0318.png


Linear Analysis Tool을 띄워주세요.


TF0319.png


EXACT LINEARIZATION Tab에서 녹색 삼각형 Linearize 아이콘을 폭풍 클릭!!


TF0322.png


그러면 Linear Analysis Workspace에 linsys1 State Space(ss) class 변수가 생성된 것을 볼 수 있습니다.

(Plot Result에서 Step, Impluse 등 그래프도 바로 그릴 수 있습니다.)

사실 위에서 했던 것은 Nonlinear Simulnik 모델을 Linearization하는 과정이었구요~ 우리는 linsys1을 얻기 위해 위의 과정을 수행하였습니다.

자~ 마지막으로 Linear Analysis Workspace에 있는 linsys1을 MATLAB Workspace로 Drag & Drop 하시면 짠!!

MATLAB Workspace에 linsys1 ss model이  복사됩니다.


TF0323.png

State Space(SS) model을 Transfer Function(TF) model로 변환하시려면 그냥 tf 함수를 사용하시면 됩니다.

(model간 변환은 추후에 다루도록 하겠습니다.)


TF0324.png


Very Good!! 맞게 나오네요 o(^o^)o

위대한 교주의 능력!! ㅋㅋ




자~ 이번시간은 여기서 마무리하죵~ 

다음시간에 뵙겠습니다. 이만...

첨부 (30)

'DSP' 카테고리의 다른 글

convolution - C++ 구현  (0) 2015.04.03
rect func fourier transform  (0) 2015.03.26
causal vs noncausal  (0) 2015.03.23
fourier property  (0) 2015.03.16
Properties of Fourier Transform  (0) 2015.03.16
Posted by bogus919
,

convolution - C++ 구현

DSP 2015. 4. 3. 17:24

/*

 * http://sosal.kr/

 * made by so_Sal

 */

 

 

 

 

y[n] = h[n]*x[n]

 



 

FIR filter는 LTI 시스템의 한 예로, 선형적이며 시불변성을 가집니다.

Impulse response h[n]은 입력이 델타로 표현될 때, y[n]을 결정시켜주는 시스템입니다.

 

h[n]에 의해 들어온 input들이 처리되어 각각의 하나의 신호를 만들며

그들이 겹쳐지는 신호합을 구하는 과정을 convolution 이라고 합니다.

 

 

 

아래는 h[n]과 x[n]의 impulse response가 주어졌을 때, y[n]을 구하는 convolution 과정입니다.

 

 

 



 

 

 

 

위의 convolution 작업을 c++을 이용하여 구현하였습니다.

 

아래는 H[n]과 X[n]이 배열로 주어졌을 때, 

Y[n] 결과와 그 Matrix를 출력하는 프로그램입니다.

 

 

 

#include <iostream>

#include <iomanip>

 

using namespace std;

 

int main()

{

    int x[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; //x[n] input

    int h[] = {1,-1, 2,-1, 1, 0, 0, 0, 0, 0, 0}; //h[n] system

 

    int matrix[100][100] = {0,};

   

    for(int i=0;i<sizeof(h)/sizeof(int); i++){

        for(int j=0;j<sizeof(x)/sizeof(int); j++){

 

            matrix[i][i+j] = h[i]*x[j]; // convolution

        }

    }

 

    for(int i=0;i<sizeof(h)/sizeof(int); i++){

        for(int j=0;j<sizeof(x)/sizeof(int); j++){

            cout<<setw(3)<<matrix[i][j];

        }cout<<endl;

    }

 

}

 


'DSP' 카테고리의 다른 글

mason's formula  (4) 2015.04.15
rect func fourier transform  (0) 2015.03.26
causal vs noncausal  (0) 2015.03.23
fourier property  (0) 2015.03.16
Properties of Fourier Transform  (0) 2015.03.16
Posted by bogus919
,

rect func fourier transform

DSP 2015. 3. 26. 00:14



time domain에서 rect func은 수많은 사인파들의 합으로 이루어져있음

여기서 수많은 사인파들은 서로 다른 freq를 갖는다.

frequency domain에서 각각의 freq에 따른 amplitude를 나타내면(fourier transform)

그 결과가 바로 sinc func이 됨.


'DSP' 카테고리의 다른 글

mason's formula  (4) 2015.04.15
convolution - C++ 구현  (0) 2015.04.03
causal vs noncausal  (0) 2015.03.23
fourier property  (0) 2015.03.16
Properties of Fourier Transform  (0) 2015.03.16
Posted by bogus919
,

causal vs noncausal

DSP 2015. 3. 23. 20:22

1. 인과성 (Causality) ㅇ 현재 출력이 현재,과거의 입력에 만 의존하는 성질 - 현재 응답이 미래 입력을 미리 요구하지 않음 - 입력이 시작되기 전에는 출력이 나오지 않음 (어느 정도 입력된 후부터 출력됨) ㅇ 인과성에 대한 필요충분조건 - 연속시스템 : 임펄스 응답 h(t) = 0 (t < 0) - 이산시스템 : 임펄스 응답 h[n] = 0 (n < 0) ㅇ 인과시스템 특징 - 물리적으로 실현가능한 시스템 . 이미 도착한 것으로부터 출력을 만들어내는 지극히 당연한 시스템 - 메모리(기억성) 여부 . 무기억 시스템은 항상 인과적임 - 위상 특성 . 인과적시스템은 영 위상일 수 없음 - 전달함수 특성 . 분모 다항식의 차수가 분자 다항식의 차수 보다 높아야 함 .. 극점(Pole)영점(Zero) 보다 많거나 같아야 함 - 임펄스응답 특성 . 임펄스응답계단함수가 될 때 즉, h(t) = u(t)이면 당연히 인과시스템 임 2. 비 인과성 (Non-causality) ㅇ 현재 출력이 현재,과거의 입력 뿐만 아니라 미래의 입력에도 영향을 받음 - 현재 응답이 미래 입력을 미리 요구하고 있음 - 만일 현재 출력이 미래 입력도 필요하다면 비인과적 . 例) y[n] = x[n+1] .. n=0 에서 y[0]=x[1] 즉, 현재 출력 y[0]이 미래 입력 x[1]을 필요로 한 경우임 - 즉, 입력이 시작되기 전부터 이미 출력이 있어 온 경우 ㅇ 비인과시스템의 대표적인 例 - 이상적인 LPF는 오히려 비인과적임 ( t<0 에서 h(t)≠0 ) - 따라서, 이상적인 필터함수에 근사화시키는 설계 방법이 쓰여지게됨



'DSP' 카테고리의 다른 글

convolution - C++ 구현  (0) 2015.04.03
rect func fourier transform  (0) 2015.03.26
fourier property  (0) 2015.03.16
Properties of Fourier Transform  (0) 2015.03.16
convolution 의미  (0) 2015.03.16
Posted by bogus919
,

fourier property

DSP 2015. 3. 16. 01:02

http://doctord.dyndns.org/courses/bei/ee301/EE235/EE235/Project/lesson17/lesson17.html

'DSP' 카테고리의 다른 글

convolution - C++ 구현  (0) 2015.04.03
rect func fourier transform  (0) 2015.03.26
causal vs noncausal  (0) 2015.03.23
Properties of Fourier Transform  (0) 2015.03.16
convolution 의미  (0) 2015.03.16
Posted by bogus919
,

The properties of the Fourier transform are summarized below. The properties of the Fourier expansion of periodic functions discussed above are special cases of those listed here. In the following, we assume $\;\;{\cal F}[x(t)]=X(j\omega)$ and ${\cal F}[y(t)]=Y(j\omega)$.

  • Linearity 

    \begin{displaymath}{\cal F}[a x(t)+b y(t)]=a{\cal F}[x(t)]+b{\cal F}[y(t)] \end{displaymath}

  • Time shift 

    \begin{displaymath}{\cal F}[x(t \pm t_0)]=X(j\omega)e^{\pm j\omega t_0} \end{displaymath}

    Proof: Let $t'=t\pm t_0$, i.e., $t = t' \mp t_0$, we have 
    $\displaystyle {\cal F}[x(t \pm t_0)]$$\textstyle =$$\displaystyle \int_{-\infty}^\infty x(t\pm t_0)
e^{-j\omega t} dt
=\int_{-\infty}^\infty x(t')e^{-j\omega(t'\mp t_0)} dt'$ 
     $\textstyle =$$\displaystyle e^{\pm j\omega t_0}
\int_{-\infty}^\infty x(t')e^{-j\omega t'} dt'=X(j\omega)e^{\pm j\omega t_0}$ 

  • Frequency shift 

    \begin{displaymath}{\cal F}^{-1}[X(j\omega \pm \omega_0)]=x(t)e^{\mp j\omega_0 t} \end{displaymath}

    Proof: Let $\omega'=\omega\pm \omega_0$, i.e., $\omega = \omega'\mp\omega_0$, we have 
    $\displaystyle {\cal F}^{-1}[X(j(\omega \pm \omega_0))]$$\textstyle =$$\displaystyle \frac{1}{2\pi}\int_{-\infty}^\infty X(j(\omega\pm \omega_0))
e^{j...
...{2\pi}\int_{-\infty}^\infty X(j\omega')e^{j\omega(\omega'\mp \omega_0)}d\omega'$ 
     $\textstyle =$$\displaystyle e^{\mp j\omega_0 t}\;\frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega')e^{j\omega'}d\omega'
=x(t)e^{\mp j\omega_0 t}$ 

  • Time reversal 

    \begin{displaymath}{\cal F}[x(-t)]=X(-\omega) \end{displaymath}

    Proof: 

    \begin{displaymath}{\cal F}[x(-t)]=\int_{-\infty}^\infty x(-t)e^{-j\omega t}dt \end{displaymath}

    Replacing $t$ by $-t'$, we get 

    \begin{displaymath}{\cal F}[x(-t)]=-\int_{\infty}^{-\infty} x(t')e^{j\omega t'}dt'
=\int_{-\infty}^{\infty} x(t')e^{j\omega t'}dt'=X(-\omega) \end{displaymath}

  • Even and Odd Signals and Spectra

    If the signal $x(t)$ is an even (or odd) function of time, its spectrum $X(j\omega)$ is an even (or odd) function of frequency: 

    \begin{displaymath}\mbox{if}\;\;x(t)=x(-t)\;\;\;\mbox{then}\;\;\;X(j\omega)=X(-j\omega) \end{displaymath}

    and 

    \begin{displaymath}\mbox{if}\;\;x(t)=-x(-t)\;\;\;\mbox{then}\;\;\;X(j\omega)=-X(-j\omega) \end{displaymath}

    Proof: If $x(t)=x(-t)$ is even, then according to the time reversal property, we have 

    \begin{displaymath}X(j\omega)={\cal F}[x(t)]={\cal F}[x(-t)]=X(-\omega) \end{displaymath}

    i.e., the spectrum $X(j\omega)=X(-\omega)$ is also even. Similarly, if $x(t)=-x(-t)$ is odd, we have 

    \begin{displaymath}X(j\omega)={\cal F}[x(t)]={\cal F}[-x(-t)]=-X(-\omega) \end{displaymath}

    i.e., the spectrum $X(j\omega)=-X(-\omega)$ is also odd.

  • Time and frequency scaling 

    \begin{displaymath}{\cal F}[x(at)]=\frac{1}{a}X(\frac{\omega}{a})\;\;\;\;\mbox{or}\;\;\;\;
{\cal F}[ax(at)]=X(\frac{\omega}{a}) \end{displaymath}

    Proof: Let $u=at$, i.e., $t=u/a$, where $a>0$ is a scaling factor, we have 

    \begin{displaymath}{\cal F}[x(at)]=\int_{-\infty}^\infty x(at)e^{-j\omega t} dt ...
... x(u)e^{-j\omega u/a} d(u/a)
=\frac{1}{a}X(\frac{\omega}{a}) \end{displaymath}

    Note that when $a<1$, time function $x(at)$ is stretched, and $X(j\omega/a)$ is compressed; when $a>1$$x(at)$ is compressed and $X(j\omega/a)$ is stretched. This is a general feature of Fourier transform, i.e., compressing one of the $x(t)$ and $X(j\omega)$ will stretch the other and vice versa. In particular, when $a\rightarrow 0$$x(at)$is stretched to approach a constant, and $X(j\omega/a)/a$ is compressed with its value increased to approach an impulse; on the other hand, when $a \rightarrow \infty$$ax(at)$ is compressed with its value increased to approach an impulse and $X(j\omega/a)$ is stretched to approach a constant.

  • Complex Conjugation


    \begin{displaymath}\mbox{if}\;\;\;{\cal F}[x(t)]=X(j\omega), \;\;\;\;
\mbox{then}\;\;{\cal F}[x^*(t)]=X^*(-j\omega) \end{displaymath}

    Proof: Taking the complex conjugate of the inverse Fourier transform, we get 

    \begin{displaymath}x^*(t)=[\frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega) e^{j\o...
...2\pi}\int_{-\infty}^\infty X^*(j\omega) e^{-j\omega t} d\omega \end{displaymath}

    Replacing $\omega$ by $-\omega'$ we get the desired result: 

    \begin{displaymath}x^*(t)=\frac{1}{2\pi}\int_{-\infty}^\infty X^*(-\omega') e^{j\omega't} d\omega'
={\cal F}^{-1}[X^*(-\omega)] \end{displaymath}

    We further consider two special cases:
    • If $x(t)=x^*(t)$ is real, then 
        $\displaystyle {\cal F}[x(t)]=X(j\omega)=X_r(j\omega)+jX_i(j\omega)$ 
       $\textstyle =$$\displaystyle {\cal F}[x^*(t)]=X^*(-\omega)=X_r(-\omega)-jX_i(-\omega)$ 

      i.e., the real part of the spectrum is even (with respect to frequency $\omega$), and the imaginary part is odd: 

      \begin{displaymath}\left\{ \begin{array}{l} X_r(j\omega)=X_r(-j\omega)  X_i(j\omega)=-X_i(-j\omega) \end{array}
\right. \end{displaymath}

    • If $x(t)=-x^*(t)$ is imaginary, then 
        $\displaystyle {\cal F}[x(t)]=X(j\omega)=X_r(j\omega)+jX_i(j\omega)$ 
       $\textstyle =$$\displaystyle {\cal F}[-x^*(t)]=-X^*(-j\omega)=-X_r(-j\omega)+jX_i(-j\omega)$ 

      i.e., the real part of the spectrum is odd, and the imaginary part is even: 

      \begin{displaymath}\left\{ \begin{array}{l} X_r(j\omega)=-X_r(-j\omega)  X_i(j\omega)=X_i(-j\omega) \end{array}
\right. \end{displaymath}

    If the time signal $x(t)$ is one of the four combinations shown in the table (real even, real odd, imaginary even, and imaginary odd), then its spectrum $X(j\omega)$ is given in the corresponding table entry:

     if $x(t)$ is realif $x(t)$ is imaginary
     $X_r$ even, $X_i$ odd$X_r$ odd, $X_i$ even
    if $x(t)$ is Even  
    $X_r$ and $X_i$ even$X_i=0$$X=X_r$ even$X_r=0$$X=X_i$ even
    if $x(t)$ is Odd  
    $X_r$ and $X_i$ odd$X_r=0$$X=X_i$ odd$X_i=0$$X=X_r$ odd

    Note that if a real or imaginary part in the table is required to be both even and odd at the same time, it has to be zero.

    These properties are summarized below:

     $x(t)=x_r(t)+jx_i(t)$$X(j\omega)=X_r(j\omega)+jX_i(j\omega)$
    1real $x(t)=x_r(t)$even $X_r(j\omega)$, odd $X_i(j\omega)$
    2real and even $x(-t)=x_r(t)$real and even $X_r(j\omega)$
    3real and odd $x(-t)=-x_r(t)$imaginary and odd $X_i(j\omega)$
    4imaginary $x(t)=x_i(t)$odd $X_r(j\omega)$, even $X_i(j\omega)$
    5imaginary and even $x(-t)=x_i(t)$imaginary and even $X_i(j\omega)$
    6imaginary and odd $x(-t)=-x_i(t)$real and odd $X_r(j\omega)$

    As any signal can be expressed as the sum of its even and odd components, the first three items above indicate that the spectrum of the even part of a real signal is real and even, and the spectrum of the odd part of the signal is imaginary and odd.

  • Symmetry (or Duality)


    \begin{displaymath}\mbox{if}\;\;\;{\cal F}[x(t)]=X(j\omega),\;\;
\mbox{then}\;\;{\cal F}[X(t)]=2\pi\;x(-j\omega) \end{displaymath}

    Or in a more symmetric form: 

    \begin{displaymath}\mbox{if}\;\;\;{\cal F}[x(t)]=X(f),\;\;
\mbox{then}\;\;{\cal F}[X(t)]=x(-f) \end{displaymath}

    Proof: As ${\cal F}[x(t)]=X(j\omega)$, we have 

    \begin{displaymath}x(t)={\cal F}^{-1}[X(j\omega)]
=\frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega)e^{j\omega t}d\omega
\end{displaymath}

    Letting $t'=-t$, we get 

    \begin{displaymath}x(-t')=\frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega)e^{-j\omega t'}d\omega \end{displaymath}

    Interchanging $t'$ and $\omega$ we get: 

    \begin{displaymath}2\pi x(-\omega)=\int_{-\infty}^\infty X(t')e^{-j\omega t'}dt'={\cal F}[X(t)] \end{displaymath}

    or 

    \begin{displaymath}x(-f)=\int_{-\infty}^\infty X(t')e^{-j2\pi ft'}dt'={\cal F}[X(t)] \end{displaymath}

    In particular, if the signal is even: 

    \begin{displaymath}x(t)=x(-t) \end{displaymath}

    then we have 

    \begin{displaymath}\mbox{if}\;\;\;{\cal F}[x(t)]=X(f),\;\;\mbox{then}\;\;{\cal F}[X(t)]=x(f) \end{displaymath}

    For example, the spectrum of an even square wave is a sinc function, and the spectrum of a sinc function is an even square wave.

  • Multiplication theorem


    \begin{displaymath}\int_{-\infty}^\infty x(t)y^*(t) dt
=\frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega)Y^*(j\omega) d\omega \end{displaymath}

    Proof: 
      $\displaystyle \int_{-\infty}^\infty x(t)y^*(t) dt
=\int_{-\infty}^\infty x(t) [\frac{1}{2\pi}\int_{-\infty}^\infty Y^*(j\omega)e^{-j\omega t}d\omega]dt$ 
     $\textstyle =$$\displaystyle \frac{1}{2\pi}\int_{-\infty}^\infty Y^*(j\omega)[\int_{-\infty}^\...
...dt] d\omega
=\frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega)Y^*(j\omega) d\omega$ 

  • Parseval's equation

    In the special case when $y(t)=x(t)$, the above becomes the Parseval's equation (Antoine Parseval 1799)

    \begin{displaymath}\int_{-\infty}^\infty \vert x(t)\vert^2 dt
=\frac{1}{2\pi}\i...
...^\infty S_X(j\omega) d\omega
= \mbox{Total energy in $x(t)$}
\end{displaymath}

    where 

    \begin{displaymath}S_X(j\omega)\stackrel{\triangle}{=}\vert X(j\omega)\vert^2 \end{displaymath}

    is the energy density function representing how the signal's energy is distributed along the frequency axes. The total energy contained in the signal is obtained by integrating $S(j\omega)$ over the entire frequency axes.

    The Parseval's equation indicates that the energy or information contained in the signal is reserved, i.e., the signal is represented equivalently in either the time or frequency domain with no energy gained or lost.

  • Correlation

    The cross-correlation of two real signals $x(t)$ and $y(t)$ is defined as 

    \begin{displaymath}R_{xy}(t)\stackrel{\triangle}{=}\int_{-\infty}^\infty x(\tau)y(\tau-t)d\tau
=\int_{-\infty}^\infty x(t+\tau)y(\tau)d\tau \end{displaymath}

    Specially, when $x(t)=y(t)$, the above becomes the auto-correlation of signal $x(t)$ 

    \begin{displaymath}R_{x}(t)\stackrel{\triangle}{=}\int_{-\infty}^\infty
x(\tau)x(\tau-t)d\tau \end{displaymath}

    Assuming ${\cal F}[x(t)]=X(j\omega)$, we have ${\cal F}[x(t-\tau)]=X(j\omega)e^{-j\omega\tau}$ and according to multiplication theorem, $R_x(\tau)$ can be written as 
    $\displaystyle R_x(\tau)$$\textstyle =$$\displaystyle \int_{-\infty}^\infty x(t)x(t-\tau)dt
=\frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega)X^*(j\omega)e^{j\omega\tau}d\omega$ 
     $\textstyle =$$\displaystyle \frac{1}{2\pi}\int_{-\infty}^\infty \vert X(j\omega)\vert^2e^{j\o...
...infty}^\infty S_X(j\omega) e^{j\omega\tau}d\omega
= {\cal F}^{-1}[S_X(j\omega)]$ 

    i.e., 

    \begin{displaymath}{\cal F}[R_x(t)]=S_X(j\omega) \end{displaymath}

    that is, the auto-correlation and the energy density function of a signal $x(t)$ are a Fourier transform pair.

  • Convolution Theorems

    The convolution theorem states that convolution in time domain corresponds to multiplication in frequency domain and vice versa: 

    \begin{displaymath}{\cal F}[x(t)*y(t)]=X(j\omega)\;Y(j\omega) \;\;\;\;\;\;(a)\end{displaymath}


    \begin{displaymath}{\cal F}[x(t)\;y(t)]=X(j\omega)*Y(j\omega) \;\;\;\;\;\;(b)\end{displaymath}

    Proof of (a): 
    $\displaystyle {\cal F}[x(t)*y(t)]$$\textstyle =$$\displaystyle \int_{-\infty}^\infty [ \int_{-\infty}^\infty
x(\tau)y(t-\tau)d\tau] e^{-j\omega t} dt$ 
     $\textstyle =$$\displaystyle \int_{-\infty}^\infty x(\tau) [ \int_{-\infty}^\infty
y(t-\tau) e^{-j\omega t} dt] d\tau$ 
     $\textstyle =$$\displaystyle \int_{-\infty}^\infty x(\tau) e^{-j\omega \tau}[ \int_{-\infty}^\infty
y(t-\tau) e^{-j\omega(t-\tau)} d(t-\tau)] d\tau$ 
     $\textstyle =$$\displaystyle X(j\omega) \; Y(j\omega)$ 

    Proof of (b): 
    $\displaystyle {\cal F}[x(t)\;y(t)]$$\textstyle =$$\displaystyle \int_{-\infty}^\infty x(t)\;y(t) e^{-j\omega t} dt$ 
     $\textstyle =$$\displaystyle \int_{-\infty}^\infty [\frac{1}{2\pi}\int_{-\infty}^\infty
X(j\omega') e^{j\omega't} d\omega'] \; y(t) e^{-j\omega t} dt$ 
     $\textstyle =$$\displaystyle \frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega') [ \int_{-\infty}^\infty
y(t) e^{j\omega't} e^{-j\omega t} dt] d\omega'$ 
     $\textstyle =$$\displaystyle \frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega') [\int_{-\infty}^\infty
y(t) e^{-j(\omega-\omega')t} dt] d\omega'$ 
     $\textstyle =$$\displaystyle \frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega') Y(j(\omega-\omega')) d\omega'
= X(j\omega) * Y(j\omega)$ 

  • Time Derivative 

    \begin{displaymath}{\cal F}[\frac{d}{dt}x(t)]=j\omega\;X(j\omega) \end{displaymath}

    Proof: Differentiating the inverse Fourier transform $X(j\omega)$ with respect to $t$ we get: 
    $\displaystyle \frac{d}{dt} x(t)$$\textstyle =$$\displaystyle \frac{d}{dt} [\frac{1}{2\pi}
\int_{-\infty}^\infty X(j\omega)e^{j...
...frac{1}{2\pi}\int_{-\infty}^\infty X(j\omega) \frac{d}{dt}e^{j\omega t} d\omega$ 
     $\textstyle =$$\displaystyle \frac{1}{2\pi}\int_{-\infty}^\infty [j\omega X(j\omega)] e^{j\omega t} d\omega
= {\cal F}^{-1} [j\omega X(j\omega)]$ 

    Repeating this process we get 

    \begin{displaymath}{\cal F}[\frac{d^n}{dt^n} x(t)]=(j\omega)^nX(j\omega) \end{displaymath}

  • Time Integration

    First consider the Fourier transform of the following two signals: 

    \begin{displaymath}u(t)=\left\{ \begin{array}{ll} 0 & t<0 \ 1 & t>0 \end{array}...
...} -1/2 & t<0 \ 1/2 & t>0 \end{array}\right. =u(t)-\frac{1}{2}
\end{displaymath}


    \begin{displaymath}\frac{d}{dt}u(t)=\delta(t), \;\;\;\;\;\;\;
\frac{d}{dt} sgn(t)=\frac{d}{dt} [u(t)-\frac{1}{2}]=\delta(t) \end{displaymath}

    According to the time derivative property above 

    \begin{displaymath}X(j\omega)={\cal F}[x(t)]=\frac{1}{j\omega}{\cal F}[ \frac{d}{dt}x(t) ] \end{displaymath}

    we get 

    \begin{displaymath}{\cal F}[u(t)]=\frac{1}{j\omega}{\cal F}[ \frac{d}{dt}x(t)]=
\frac{1}{j\omega}{\cal F}[ \delta(t)]=\frac{1}{j\omega} \end{displaymath}

    and 

    \begin{displaymath}{\cal F}[sgn(t)]=\frac{1}{j\omega}{\cal F}[ \frac{d}{dt}sgn(t)]=
\frac{1}{j\omega}{\cal F}[ \delta(t)]=\frac{1}{j\omega} \end{displaymath}

    Why do the two different functions have the same transform?

    In general, any two function $f(t)$ and $g(t)=f(t)+c$ with a constant difference $c$ have the same derivative $d\;f(t)/dt$, and therefore they have the same transform according the above method. This problem is obviously caused by the fact that the constant difference $c$ is lost in the derivative operation. To recover this constant difference in time domain, a delta function needs to be added in frequency domain. Specifically, as function $sgn(t)$ does not have DC component, its transform does not contain a delta: 

    \begin{displaymath}{\cal F}[sgn(t)]=\frac{1}{j\omega} \end{displaymath}

    To find the transform of $u(t)$, consider 

    \begin{displaymath}u(t)=sgn(t)+\frac{1}{2} \end{displaymath}

    and 

    \begin{displaymath}{\cal F}[u(t)]={\cal F}[sgn(t)]+{\cal F}[\frac{1}{2}]
=\frac{1}{j\omega}+\pi \delta(\omega) \end{displaymath}

    The added impulse term $\pi \delta(\omega)$ directly reflects the constant $c=1/2$ in time domain.

    Now we show that the Fourier transform of a time integration is 

    \begin{displaymath}{\cal F}[\int_{-\infty}^t x(\tau) d\tau] =\frac{1}{j\omega}\;X(j\omega)
+\pi X(0)\delta(\omega) \end{displaymath}

    Proof:

    First consider the convolution of $x(t)$ and $u(t)$

    \begin{displaymath}x(t)*u(t)=\int_{-\infty}^{\infty} x(\tau)u(t-\tau) d\tau
=\int_{-\infty}^t x(\tau) d\tau \end{displaymath}

    Due to the convolution theorem, we have 

    \begin{displaymath}{\cal F}[\int_{-\infty}^t x(\tau) d\tau]=
{\cal F}[x(t)*u(t)]...
...\omega)]
=\frac{1}{j\omega}\;X(j\omega)+\pi X(0)\delta(\omega) \end{displaymath}

  • Frequency Derivative 

    \begin{displaymath}{\cal F}[tx(t)]=j\frac{d}{d\omega}X(j\omega) \end{displaymath}

    Proof: We differentiate the Fourier transform of $x(t)$ with respect to $\omega$ to get 
    $\displaystyle \frac{d}{d\omega}X(j\omega)$$\textstyle =$$\displaystyle \frac{d}{d\omega}[\int_{-\infty}^\infty
x(t)e^{-j\omega t}dt]
=\int_{-\infty}^\infty x(t)\frac{d}{d\omega}e^{-j\omega t}dt$ 
     $\textstyle =$$\displaystyle \int_{-\infty}^\infty x(t)(-jt)e^{-j\omega t}dt$ 

    i.e., 

    \begin{displaymath}{\cal F}[-jt x(t)]=\frac{d}{d\omega}X(j\omega) \end{displaymath}

    Multiplying both sides by $j$, we get 

    \begin{displaymath}j\frac{d}{d\omega}X(j\omega)
=\int_{-\infty}^\infty tx(t)e^{-j\omega t}dt
={\cal F}[tx(t)]
\end{displaymath}

    Repeating this process we get 

    \begin{displaymath}{\cal F}[t^n x(t)]=j^n \frac{d^n}{d\omega^n}X(j\omega) \end{displaymath}


'DSP' 카테고리의 다른 글

convolution - C++ 구현  (0) 2015.04.03
rect func fourier transform  (0) 2015.03.26
causal vs noncausal  (0) 2015.03.23
fourier property  (0) 2015.03.16
convolution 의미  (0) 2015.03.16
Posted by bogus919
,

convolution 의미

DSP 2015. 3. 16. 00:36

많은 학생들이 convolution의 의미를 모르고 그냥 배운대로 계산만 하는것 같다. 얼마전 아는 후배도 convolution의 의미에 대해 물어본적이 있는데 나도 학부시절 고민하던 것으로 혼자 골똘히 생각해 보다 이해하게 된 것인데 전자공학을 공부하는 학부생들의 이해를 돕고자 글을 올린다.


간단히 convolution의 의미에 대해 말하자면 시스템에 메모리가 있는 경우 한 시스템의 출력이 현재 입력에 의해서만 결정되는 것이 아닌 이전 입력(causal system 이라면)에 의해서도 영향을 받기 때문에 그에 대한 출력을 나타내기 위해 하는 연산이다.
예를 들어 종(鍾)을 LTI(Liner Time Invariant) 시스템이라고 가정한다면 종을 한번 치면 그 소리가 치는 순간만 나는게 아니라 치는 순간에 소리가 크게 났다가 점점 소리가 감쇠되며 작아진다.

이해를 돕고자 그림으로 나타내면 다음 그림의 첫번째 경우와 같다. 종을 한번 탕 치는 것을 impulse 입력이라 하고 한번 종을 쳤을 때 나는 소리를 삼각형으로 나타냇다.

그런데 종을 한번 치고 다시 치면 어떨까? 그림의 두번째 경우는 처음 종을 치고 잠시 후 이전보다 약하게 친 경우이다. 이 때는 종소리를 Linear system으로 가정했기 때문에 이전의 입력에 의해 나고 있는 소리에 현재 입력에 의해 나는 소리가 더해져 나타난다. 그리고 이것은 impulse 입력과 종소리의 convolution 과 같은 결과가 나올 것이다.

따라서 convolution은 한 LTI 시스템에 대해 현재와 이전의 입력에 대한 출력을 계산하기 위해 수행하는 것이다.


그림의 두번째 경우를 보면 왜 컨볼루션을 할 때 system이나 입력중 하나를 반전시켜야 하는지에 대해 알 수 있다.
한 시스템에 시간적으로 앞선 입력을 먼저 넣고 그 후에 시간적으로 나중에 발생한 입력을 넣어야 올바른 출력을 얻을 수 있기 때문에 시간적으로 앞선 입력을 먼저 넣기 위해 입력을 반전시키거나 시스템을 반전시키는 것이다.

입력을 반전시키지 않으면 처음에 종을 약하게 치고 그 후에 세게 친것과 같은 결과가 나오기 때문에 시간적으로 반대의 결과가 나온다.


'DSP' 카테고리의 다른 글

convolution - C++ 구현  (0) 2015.04.03
rect func fourier transform  (0) 2015.03.26
causal vs noncausal  (0) 2015.03.23
fourier property  (0) 2015.03.16
Properties of Fourier Transform  (0) 2015.03.16
Posted by bogus919
,