📄 trainsig.m
字号:
%TRAINSIG Modulates binary data with discrete multitone modulation.% Y = TRAINSIG(X,L,N,F,P) returns a DMT training signal in Y. %% X is length-N binary input sequence to be modulated where N is the FFT% size in the DMT modulation. L*N is the length of Y. F is a flag if set % to 1 then Y is periodic with N. P 在直流旁边的不用的子信道的数目defines the number of unused % subchannels near DC.%generate L symbol training sequence from binary data x function [y, Fx] = trainsig(x,L,flag,P)x = x(:).'; %变成列向量再转置 还是行向量N = length(x); if flag == 0 x = x(1:N-1); x1 = kron(ones(1,L),x); %将X1循环L次 行向量 一共L×(n-1) x15 = [x1 x1(1:L)]; %一共L×n x2 = reshape(x15,2,L*N/2); %两行 else x1 = reshape(x,2,N/2); x2 = kron(ones(1,L),x1); %将X1循环L次 行向量endx3 = -2*(x2 - 0.5); %从0 1变成-1 1?x4 = x3(1,:)+j*x3(2,:); %第一行实部 第二行做虚部 x5 = reshape(x4,N/2,L).'; %共L行 每一行是半个符号?x5(:,1:P) = zeros(L,P); x6 = [zeros(L,1) x5(:,2:N/2) zeros(L,1) fliplr(conj(x5(:,2:N/2))) ].'; %共L行 每一行是一个符号x7 = real(1/sqrt(N)*ifft(x6)); %***********why 1/sqrt(N) not sqrt(N) 1/N***************************x8 = reshape(x7,1,N*L);y = x8;Fx = x6;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -