SAYISAL HABERLEŞME MATLAB UYGULAMALARI 1-KONVOLÜSYON UYGULAMALARI Matlab ile hazır olarak kullanılan conv,conv2,convn hazır fonksiyonları bulunmakla birlikte konvolüsyon sonucunun ‘0’ sıfır indisli değerinin de bulunması için aşağıdaki fonksiyon yazılmış ve bu fonksiyon kullanılarak bir örnek uygulama gerçekleştirilmiştir. function [y,ny] = conv_m(x,nx,h,nh) nyb=nx(1)+nh(1); nye = nx(length(x)) + nh(length(h)); ny=[nyb:nye] ; y = conv(x,h); end Örnek-1 clear all close all clc x=[3. 11, 7, 0, -1. 4, 2]; h=[2, 3, 0, -5, 2, 1]; nx =[-3:3]; nh=[-1:4]; [y,ny]=conv_m(x,nx,h,nh) SONUÇ: y =6 31 47 6 -51 -5 41 18 -22 -3 8 2 ny =-4 -3 -2 -1 0 1 2 3 4 5 6 7 Örnek-2 clear all close all clc t=0:0.05:3.1; x=exp(-5*t); subplot(3,1,1) plot(t,x); h=[zeros(1,length(t)/3) ones(1,length(t)/3) zeros(1,length(t)/3)] ; subplot(3,1,2) plot(t,h) subplot(3,1,3) y=(conv(h,x)); t2=0:0.05:6.2; plot(t2,y)
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SAYISAL HABERLEŞME MATLAB UYGULAMALARI
1-KONVOLÜSYON UYGULAMALARI
Matlab ile hazır olarak kullanılan conv,conv2,convn hazır fonksiyonları bulunmakla birlikte
konvolüsyon sonucunun ‘0’ sıfır indisli değerinin de bulunması için aşağıdaki fonksiyon yazılmış ve bu
fonksiyon kullanılarak bir örnek uygulama gerçekleştirilmiştir.
function [y,ny] = conv_m(x,nx,h,nh) nyb=nx(1)+nh(1); nye = nx(length(x)) + nh(length(h)); ny=[nyb:nye] ; y = conv(x,h); end
Burada snr (Sinyal/Gürültü Oranı) değerini -10 ile 10 arasında değiştirerek sinyalde oluşan
bozulmayı gözlemleyiniz.
clear all close all clc t = 0:0.001:5; x = (1.3)*sin(2*pi*1*t) + (1.7)*sin(2*pi*4*t); plot(t,x) snr=0; figure y=awgn(x,snr); plot(t,y) xlabel('Zaman') ylabel('Genlik')
2-FOURİER DÖNÜŞÜMÜ UYGULAMALARI
clear all close all clc fs = 200; t = 0:1/fs:10-1/fs; x = (1.3)*sin(2*pi*15*t) + (1.7)*sin(2*pi*40*t) + 1.5*sin(2*pi*75*t); snr=0; x= awgn(x,snr); subplot(3,1,1) plot(t,x) xlabel('Zaman') ylabel('Genlik')
y = fft(x); n = length(x); f = (0:n-1)*(fs/n); power = abs(y).^2/n; subplot(3,1,2) plot(f,power)