Presentation is loading. Please wait.

Presentation is loading. Please wait.

GoldExperience 통신공학설계실험 Kim Hyun Tai

Similar presentations


Presentation on theme: "GoldExperience 통신공학설계실험 Kim Hyun Tai"— Presentation transcript:

1 GoldExperience 통신공학설계실험 2003440033 Kim Hyun Tai
Kim Jung Woo Kim Dae Hyun

2 실험전 선행조사 및 문제풀이 ○ 다음 용어 / 명령어를 조사하라.
Algorithm : Discrete Fourier Transform Fast Fourier Transform fft_mod (in ex.3.26) Example 3.26 Flowchart 분석 및 실행 Example 3.27 Flowchart 분석 및 실행 명령어 조사: echo on, zeros, size, ones, length, fftshift, stem, conv, 기타 2

3 Algorithm 조사(1) Discrete Fourier Transform
☞ 우리가 다루는 신호는 연속신호(아날로그 신호)이지만 컴퓨터가 다루는 신호는 이산신호(디지털 신호)이다. 이와 같이 연속신호를 이산적인 신호로 나타내는 푸리에 변환을 Discrete Fourier Trans form(이산 푸리에 변환)이라고 한다. Fast Fourier Transform ☞ 이산 데이터 값들의 푸리에 변환 계산을 위한 알고리즘이다. FFT 는 주어진 유한 데이터 점들의 세트, 즉 예를 들어 실세계 신호로 부터 주기적으로 얻어지는 견본들을, 그 요소 주파수들의 형태로 표현한다. 3

4 Algorithm 조사(2) fft_mod 4

5 명령어 echo on : 모든 명령어 파일에 있는 명령어들을 화면에 보이게 한다.
echo off: 모든 명령어 파일에 있는 명령어들을 화면에 보이지 않게 한다. echo fname: fname.m 파일에 있는 명령어들을 화면에 보이게 한다. echo on all : 모든 함수 파일에 있는 명령어들을 화면에 보이게 한다. echo off all: 모든 함수 파일에 잇는 명령어들을 화면에 보이지 않게 한다. zeros(n) : zeros n by n 행렬을 생성한다. size(X): X행렬과 같은 크기의 행렬을 만든다. ones: 모든 원소가 1인 행렬을 만들 때 쓴다 fftshift: 0 에서 2pi 의 구간을 -pi 에서 pi 의 형태로 바꿔준다. stem : 해당 값만큼 직선 막대 + o 표시 conv: 컨볼루션을 하고, 다항식의 곱셈을 해주는 명령어 5

6 문 제 풀 이(Example 3.26) % Fourier transform clear echo on
df=0.01; %frequency resolution fs=10; %sampling frequency ts=1/fs; %sampling period T1=-5; T2=5; %observation time interval (from T1 to T2 sec) t=[T1:ts:T2]; %observation time vector % Signal genaration of rectangular pulse x1=zeros(size(t)); x1(41:61)=ones(size(x1(41:61))); [X1,x11,df1]=fft_mod(x1,ts,df); X11=X1/fs; %scaling f=[0:df1:df1*(length(x11)-1)]-fs/2; %frequency vector (range to plot) plot(t,x1); axis([T1 T2 -2 4]) title('Waveform of rectangular pulse'); 6

7 문 제 풀 이(Example 3.26) pause %Press any key to see magnitude spectrum
mag_X11=fftshift(abs(X11)); plot(f,mag_X11) title('Magnitude spectrum of rectangular pulse'); pause %%Press any key to see spectrum in dB scale mag_X11_db=20*LOG10(mag_X11); plot(f,mag_X11_db); axis([ ]) title('Energy spectrum of rectangular pulse (dB scale)'); pause %%Press any key to continue % Signal generation of triangular pulse x2=zeros(size(t)); x2(41:51)=t(41:51)+1; x2(52:61)=-t(52:61)+1; [X2,x21,df1]=fft_mod(x2,ts,df); X21=X2/fs; f=[0:df1:df1*(length(x21)-1)]-fs/2; 7

8 문 제 풀 이(Example 3.26) f=[0:df1:df1*(length(x21)-1)]-fs/2; figure
plot(t,x2); axis([T1 T2 -2 4]) title('Waveform of triangular pulse'); pause %Press any key to see magnitude spectrum mag_X21=fftshift(abs(X21)); plot(f,mag_X21) title('Magnitude spectrum of triangular pulse'); pause %%Press any key to see spectrum in dB scale mag_X21_db=20*LOG10(mag_X21); plot(f,mag_X21_db); axis([ ]) title('Energy spectrum of triangular pulse (dB scale)'); 8

9 PLOT 결과(Example 3.26) 그림1 그림2 9

10 PLOT 결과(Example 3.26) 그림3 그림4 10

11 PLOT 결과(Example 3.26) 그림5 그림6 11

12 문 제 풀 이(Example 3.27) % LTI system analysis in frequency domain
echo on df=0.01; % Freq. resolution fs=10; % Sampling frequency => 10 samples per sec ts=1/fs; % Sampling interval t=[-5:ts:5]; % Time vector x=zeros(1,length(t)); % Generate input signal x(31:40)=2*ones(1,10); % x(t)=0 for -2<t<-1 x(41:61)=2-2*cos(0.5*pi*t(41:61)); % x(t)=2-2cos(pi*t/2) for -1<t<1 x(62:71)=2*ones(1,10); % x(t)=1 for 1<t<2 x(72:91)=4-t(72:91); % x(t)=4-t for 2<t<4 pause %Press any key to see input signal waveform plot(t,x); axis([ ]) title('Input signal waveform'); 12

13 문 제 풀 이(Example 3.27) % Part 1 [X,x1,df1]=fft_mod(x,ts,df); % Spectrum of the input f=[0:df1:df1*(length(x1)-1)]-fs/2; % Frequency vector X1=X/fs; % Scaling pause % Press any key to see spectrum of the input plot(f,fftshift(abs(X1))) title('Magnitude spectrum of the input signal'); % Ideal Lowpass Filter transfer function H=[ones(1,ceil(1.5/df1)),zeros(1,length(X)-2*ceil(1.5/df1)),ones(1,ceil(1.5/df1))]; Y=X.*H; % Output spectrum y1=ifft(Y); % Output of the filter pause % Press any key to see the output of the lowpass filter plot(t,abs(y1(1:length(t)))); title('Filtered output signal'); 13

14 문 제 풀 이(Example 3.27) % Part 2 % LTI system impulse response
h=zeros(1,length(t)); h(51:60)=t(51:60); % h(t)=t for 0<t<1 h(61:70)=2-t(61:70); % h(t)=2-t for 1<t<2 pause % Press any key to see the impulse response of the system plot(t,h); axis([ ]) title('Impulse response of the system'); [H2,h2,df1]=fft_mod(h,ts,df); H21=H2/fs; f=[0:df1:df1*(length(h2)-1)]-fs/2; pause %Press any key to see the frequency response of the system mag_H21=fftshift(abs(H21)); plot(f,mag_H21) title('Magnitude response of the system'); % Compute output by convolution y2=conv(h,x); % Output of the LTI system pause % Press any key to see the output signal of the LTI system plot([-10:ts:10],y2); title('Output signal of the LTI system'); 14

15 PLOT 결과(Example 3.27) 그림1 그림2 15

16 PLOT 결과(Example 3.27) 그림3 그림4 16

17 PLOT 결과(Example 3.27) 그림5 그림6 17

18 Goldexperience 감 사 합 니 다 18


Download ppt "GoldExperience 통신공학설계실험 Kim Hyun Tai"

Similar presentations


Ads by Google