Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc; clear all; close all;
- Obraz = imread('4.1.08.tiff');
- figure(1);image(Obraz)
- y = 256*256*3;
- Pom = reshape(Obraz, 1, y);
- Wektor = de2bi(Pom);
- Y = double(Wektor);
- hx = modem.qammod('M', 16, 'SymbolOrder', 'binary', 'InputType', 'bit');
- Y = modulate(hx, Y);
- Y1024 = reshape(Y,1024,384);
- Yifft = ifft(Y1024); % odwrotna transofmrata fouriera
- Y_przedrostki = [Yifft(1015:1024,:);Yifft]; % dolozenie ostatnich 10 elementow na poczatek kazdej grupy elementow
- b = [1, 0.5, -0.7]; % wspolczynniki filtru
- Y = reshape(Y_przedrostki, numel(Y_przedrostki),1); % w filtracji potrzebny jest wektor kolumnowy
- Yf = filter(b,1,Y); % Yf - sygnal odfiltrowany
- snr = 20;
- Yf = awgn(Yf, snr); % dodawanie szumu (przechodzenie sygnalu przez kanal)
- Y1034 = reshape(Yf,1034,numel(Yf)/1034);
- Y1024 = Y1034(11:1034,:); % usuniecie 10 elementow z poczatku (przedrostkow)
- Y = fft(Y1024);
- Popr = fft(b,1024);
- b_odwrotne = 1./Popr;
- Popraw = zeros(384,1024);
- for i=1:384
- Popraw(i,:) = b_odwrotne(:);
- end
- YpoPoprawce = Y.*Popraw';
- h = modem.qamdemod('M', 16, 'PHASEOFFSET', 0, 'SYMBOLORDER', 'BINARY','OUTPUTTYPE', 'Bit', 'DECISIONTYPE', 'HARD DECISION');
- Y = demodulate(h, YpoPoprawce);
- Obraz = reshape(uint8(Y),196608,8);
- Obraz = bi2de(Obraz);
- Obraz = reshape(Obraz,256,256,3);
- image(Obraz);
- pause;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement