Doubt with my codings..Pls help me correct it

clc;
clear all;
close all;
%input
M=1024;
nt=2;
nr=1;
L=65;
%Generate random data
m=4;
msg1=randint(M/2,1,m);
figure(1)
stem(msg1)
grid on
xlabel('data points')
ylabel('transmitted data phase representation')
title('Transmitted Data "O"')
msg2=randint(M/2,1,m);
figure(2)
stem(msg2)
grid on
xlabel('data points')
ylabel('transmitted data phase representation')
title('Transmitted Data "O"')
% QPSK modulation
qpsk_modulated_data1=pskmod(msg1,m);
qpsk_modulated_data2=pskmod(msg2,m);
%scatterplot(qpsk_modulated_data1);
%title('qpsk modulated transmitted data1');
%scatterplot(qpsk_modulated_data2);
%title('qpsk modulated transmitted data2');
%IFFT
x1=ifft(qpsk_modulated_data1);
x2=ifft(qpsk_modulated_data2);
%scatterplot(x1)
%scatterplot(x2)
x=vertcat(x1,x2);
%Add CP
message = randint(1,M,4); %Assuming QPSK symbols
length_cyclic = 15;
starting =M - length_cyclic + 1;
cyclic_prefix = message(starting : end);
prefixed = horzcat(cyclic_prefix,message);
%channel
h1=gallery('circul',M:M);
h2=gallery('circul',M:M);
e=horzcat(h1,h2);
f=vertcat(h1,h2);
h=e*f;
There is no connection of adding CP with my output. How can I make it correct?

댓글 수: 7

Janet
Janet 2012년 3월 6일
@walter: Since I want quick reply,I posted again
Dr. Seis
Dr. Seis 2012년 3월 6일
What is your "doubt?" Are you receiving an error? Are the results not what you expected? We cannot divine a solution to a problem if we do not know what *is* the problem.
Janet
Janet 2012년 3월 6일
My adding of CP does not connects with the rest of the program. I am not sure whether it is right or not
Janet
Janet 2012년 3월 6일
@Jan : yes,I deleted
Jan
Jan 2012년 3월 6일
@melody: I don't like this. The voluntary contributors answer as fast they can, when they know an answer. Double posting is not an option to push the readers, because they waste time during reading the question again, which they could not answer the first time. If you do not get a fast answer, this is usually caused by an incomplete question.
Please delete the double post.
Btw. Please use meaningful tags. *All* questions in this forum concern "matlab" and "matlab code". Therefore I have deleted these tags.
Jan
Jan 2012년 3월 6일
What does "connects with the rest of the program" mean?
Janet
Janet 2012년 3월 6일
@Jan: I am a beginner and I have a doubt whether adding CP has an effect on h ( channel response)

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2012년 3월 6일

0 개 추천

Your calculation of "h" does not involve any variables defined after your very early "%input" section. Therefore, adding CP has no effect on "h", at least not in the code you have written.

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

태그

질문:

2012년 3월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by