切片matlab细胞

时间:2017-02-23 13:25:05

标签: matlab

a_1 = 1;
a_2 = sqrt(0.1);
l = -10:10;
t = 1e-6;
N = 10^6 ;
SNR = 0:10; % Valeurs du SNR en dB
a = 1/sqrt(2) ;
Es = 2*a^2 ; 
QPSK = [1+1i, 1-1i, -1-1i, -1+1i];
X_QPSK = sqrt(Es/2)*(QPSK(randi(length(QPSK),1,N)));

W = [0, 250000,50000, 500000, 1000000] ; % Vecteur des frequences

H = cell(zeros(1,length(W))) ; 
Vecteur_convolution = cell(zeros(1,length(W))) ; % convolution output
Sortie = cell(zeros(1,length(W))) ;
h0 = a_1*sinc(l)+ a_2*sinc(l-t*W(1));
h1 = a_1*sinc(l)+ a_2*sinc(l-t*W(2));
h2 = a_1*sinc(l)+ a_2*sinc(l-t*W(3));
h3 = a_1*sinc(l)+ a_2*sinc(l-t*W(4));
h4 = a_1*sinc(l)+ a_2*sinc(l-t*W(5));

H{1,1} = h0 ;
H{1,2} = h1 ;
H{1,3} = h2 ;
H{1,4} = h3; 
H{1,5} = h4; 

for i = 1:length(W)    
    Vecteur_convolution{1,i} = conv(X_QPSK, H{i}) ;  
    Sortie{1,i} =  Vecteur_convolution{i(10:lenght(X_QPSK ))} % Not correct
end



% By the way, if I write it like this, it works. But I'm trying to make it compact if possible

Sconv0 = conv(x_QPSK,h0);
S0 = Sconv0(length(SNR):length(SNR)+length(X_QPSK) - 1);

% Pour W = 50 KHz
Sconv50K = conv(x_QPSK,h1);
S50K = Sconv50K(length(SNR):length(SNR)+length(X_QPSK) - 1);

% Pour W = 250 KHz
Sconv250K = conv(x_QPSK,h2);
S250K = Sconv250K(length(SNR):length(SNR)+length(X_QPSK) - 1);

% Pour W = 500 KHz
Sconv500K = conv(x_QPSK,h3);
S500K = Sconv500K(length(SNR):length(SNR)+length(X_QPSK) - 1);

% Pour W = 1 MHz
Sconv1M = conv(x_QPSK,4);
S1M = Sconv1M(length(SNR):length(SNR)+length(X_QPSK) - 1);
早上好,伙计们。我不确定在Matlab中我想做什么是可能的,但在这里它。我正在进行卷积并将输出存储在“Vecteur_convolution”中,所以它是一个1x5的单元格。因为卷积增加了点数,我只想取回我的样本号(1.000.000)而不是(1000010)并将其存储到“Sortie”1x5单元格中。任何帮助都将受到赞赏。

0 个答案:

没有答案