Band-limited noiseless channel

📌

Consider a band-limited noiseless channel. The channel response in frequency domain is H(f)=1, |f|≤3Hz, otherwise, H(f)=0

🕦😴


📝 Code

  • main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
%% Simulate the band-limited channel.

clear;
clc;

Ts = 1; % Symbol interval.
Tb = Ts/3; % Bit interval.
fs = 1000; % Sampling rate.
dt = 1/fs; % Sampling interval.
N = 10; % Number of symbols.
t = -N/2 : dt : N/2; % Sequence transmission time.
m = [0,1,2,3,4,5,6,7]; % Equally spaced.
Am = -3.5+m; % The amplitude of the m-th waveform.

%% Task(1) Randomly generate a sequence of ten 8-PAM signals.
for i=1:length(t)
if(fix((i-1)/fs)==((i-1)/fs))
temp=randi(7);
Sm(i)=Am(temp);
else
Sm(i)=Sm(i-1);
end
end
[f,Sf] = T2F(t,Sm); % TF

figure(1)
plot(t,Sm);
xlabel('t');ylabel('Amplitude ');
title('8-PAM waveform');

figure(2)
plot(f,abs(Sf));
xlabel('f/Ts' );ylabel('');
title('8-PAM spectrum');

%% Task(2) Consider a band-limited noiseless channel.
% Generate a band-limited noiseless channel H(f)=1, |f|≤3Hz.
for k = 1 : length(f)
if abs(f(k))>3
Hf1(k)=0;
else
Hf1(k)=Ts;
end
end
for k = 1 : length(f)
if abs(f(k))>300
Hf2(k)=0;
else
Hf2(k)=Ts;
end
end

% Plot the band-limited noiseless channel.
figure(3)
plot(f,Hf1,f,Hf2);
grid on;
xlabel ('f/Ts'); ylabel('Noiseless channel spectrum');
axis([ - 400 400 0 1.2]);
legend('cut-off f=3','cut-off f=300');


% Passing through this channel.
value_t=t(1);
Xf1 = Sf.*Hf1;
Xf1 = Xf1.*exp(1i*2*pi*f*value_t);
[t,Xt1] = F2T(f,Xf1); % FT

Xf2 = Sf.*Hf2;
Xf2 = Xf2.*exp(1i*2*pi*f*value_t);
[t,Xt2] = F2T(f,Xf2); % FT

figure(4)
subplot(121)
plot(f,abs(Xf1));
xlabel('f/Ts');ylabel('');
axis([ -5 5 0 6]);
title('8-PAM waveform passomg noiseless channel spectrum');
legend('cut-off f=3');
subplot(122)
plot(f,abs(Xf2));
xlabel('f/Ts');ylabel('');
axis([ -50 50 0 6]);
title('8-PAM waveform passomg noiseless channel spectrum');
legend('cut-off f=300');

figure(5)
subplot(121)
plot(t,real(Xt1));
axis([ 0 N -4 4]);
xlabel('t');ylabel('Amplitude');
title('8-PAM waveform passing noiseless channel waveform');
legend('cut-off f=3');

subplot(122)
plot(t,real(Xt2));
axis([ 0 N -4 4]);
xlabel('t');ylabel('Amplitude');
title('8-PAM waveform passing noiseless channel waveform');
legend('cut-off f=300');
  • T2F.m
1
2
3
4
5
6
7
8
9
10
11
12
function [f,sf]=T2F(t,st)
%input is time and the signal vectors
%output is freguency and signal spectrum

dt=t(2)-t(1);
T=t(end)-t(1)+dt;
df=1/T; %smapling rate
N=length(st);

f=-N/2*df:df:(N/2-1)*df; %频域抽样点
sf=fft(st);
sf=T/N*fftshift(sf).*exp(-j*2*pi*f*t(1)); %补偿时间移位
  • F2T.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
%% Inverse Fourier Transform
function [t,st] = F2T(f,sf)
% output is time ande signal sequence
% input is frequency and signal spectrum

df = f(2) - f(1);
Fmx = f(end) - f(1) + df;
dt = 1/Fmx; % sampling rate
N = length(sf);
T = N*dt;

t = 0:dt:T-dt; % time sequence
sff = ifftshift(sf);
st = Fmx*ifft(sff);

💹 Fig

Fig.1  8-PAM waveform.

Fig.1 8-PAM waveform.




Fig.2  8-PAM spectrum.

Fig.2 8-PAM spectrum.




Fig.3  Noiseless channel spectrum.

Fig.3 Noiseless channel spectrum.




Fig.4  8-PAM waveform passing noiseless channel spectrum.

Fig.4 8-PAM waveform passing noiseless channel spectrum.




Fig.5  8-PAM waveform passing noiseless channel waveform.

Fig.5 8-PAM waveform passing noiseless channel waveform.




Discussion

  1. The response of the noise-free band-limited channel is lower than the rectangular window of H(f)=1 at the cut-off frequency. After the 8-PAM signal passes through the band-limited channel, the high-frequency information is filtered out, and the restored information waveform becomes smooth; if continue to increase the cut-off frequency, the restored signal waveform will contain more original information, and the same bit error rate will decrease accordingly.
  2. The result of time domain convolution is the same as the result of inverse Fourier transform after frequency multiplication.
  3. Under a band-limited noiseless channel, the larger the passband, the smoother the signal.
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

请我喝杯咖啡吧~