Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Matlab by anon ( 6 years ago )
clear all;
close all;


% a)
%-------------------------------------------------------------
load signal.mat

N = length(signal);
x = 2*((-N/2):((N/2)-1))/N;

y = signal;
y_fft = fftshift(abs(fft(y)));

figure(1);
plot(x, 20*log10(y_fft));
title('widmo sygnału / struktura kanału DVB-T');
%-------------------------------------------------------------


% b)
%-------------------------------------------------------------
[y_acorr, lag] = xcorr(y, y);
y_acorr_abs = abs(y_acorr);

figure(2);
plot(lag, y_acorr_abs);
title('funkcja autokorelacji sygnału');

figure(3);
plot(lag, y_acorr_abs);
title('funkcja autokorelacji sygnału');
xlim([-5e4, 5e4]);
ylim([0, 7e11]);
%-------------------------------------------------------------


% c)
%-------------------------------------------------------------
sym_len_calculated = 10751.9496;
CP_calculated = sym_len_calculated/4;

sym_len = round(sym_len_calculated);
CP = round(CP_calculated);
cp_corr = correlate_cp_MM6(y, sym_len, CP);

figure(4);
plot(abs(cp_corr));
title('detekcja początków symboli');

figure(5);
plot(abs(cp_corr));
title('detekcja początków symboli');
xlim([0, 7e4]);

first_peak = 6927; 
single_sym = y(first_peak:first_peak+sym_len);

figure(6);
plot(abs(single_sym));
title('pojedynczy symbol');
%-------------------------------------------------------------


% d)
%-------------------------------------------------------------
single_sym_OFDM = OFDM_transform_MM6(single_sym, sym_len, 8192);

figure(7);
plot(single_sym_OFDM, '.');
title('przetransformowany symbol');
%-------------------------------------------------------------


% e)
%-------------------------------------------------------------
single_sym_OFDM_cut = single_sym_OFDM((8192-6817+1)/2+(1:6817));

figure(8);
plot(single_sym_OFDM_cut, '.');
title('6817 użytecznych częstotliwości');
%-------------------------------------------------------------


% f)
%-------------------------------------------------------------
wk_sequence = get_wk_sequence(6817);

pilots = get_pilots('8k');
sym = symbol_filter_MM6(single_sym_OFDM_cut, pilots, wk_sequence);

figure(9);
plot(sym, '.');
title('get\_pilots(''8k'')');

pilots = get_pilots('8k', 3);
sym = symbol_filter_MM6(single_sym_OFDM_cut, pilots, wk_sequence);

figure(10);
plot(sym, '.');
title('get\_pilots(''8k'', 3)');
%-------------------------------------------------------------

 

Revise this Paste

Parent: 113186
Your Name: Code Language: