Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
.The transmitted signal is single carrier with root raised cosine filter.
• Filter coefficient is 0.3
• Modulation: BPSK
• OSR: 16 in the recording (TDMA125KHzSpan.mat)

The signal has replica of m-sequences (m=6) as training one in the
front the other one at the end of the frame. And the user data is cascaded at end of each
other. The frame structure can be summarized as in [m-seq, data0, data1, data2, data3, m-
seq] and each data part has 91 symbols. Take last 2 digits of your U#, modulo 3 it and the
resulting number is your data (mod(XY,3) = d).
Q1. Demodulate the d th data frame and obtain the text message sent to you.

What I have tried:

clear all
load('/home/sudipta/Documents/Tutorpoint_Assignments/lab_7.mat')
OSR = 16;
seq2 = mseq(2,8);
length1 = length(seq2)*OSR;
length2 = length(seq2)*OSR;
plot(10*log10(abs(Y)));
figure()
pwelch(Y,[],[],[],'centered')
alpha=0.3;
sampling=16;
span=40;
fltr = rcosdesign(alpha,span,sampling,'sqrt');
filtered_signl = filter(fltr,1,Y);
figure()
pwelch(filtered_signl,[],[],[],'centered')

for i = 1:length(filtered_signl)-2*length1
width1 = filtered_signl(i:i+length1-1);
width2 = filtered_signl(i+length1:i+length1+length2-1);
x(i) = abs(width1'*width2);
end
figure()
plot(x)
filtr_p = 5564;
[max_peak,max_time] = max(x)
signlf = filtered_signl(max_time:length(filtered_signl));
scatterplot(signlf);
eyediagram(signlf,32);
for l = 1:length1

mismatch(l) =conj(signlf(l)).*(signlf(length1+l));
angD(l) = angle(mismatch(l));
end
meanf = mean(angD);

for i = 1:7
fltr(i) = (meanf +2*pi*(i-5))/(2*pi*length1*(1/(10e3*OSR)));
end

for q = 1:7
for p = 0:length(filtered_signl)-1
shiftf(p+1) =filtered_signl(p+1).exp(-1i*2*pi*fltr(q)*p(1/(10e3*OSR))) ;
end
end

for p = 0:length(filtered_signl)-1
shiftf(p+1) =filtered_signl(p+1).exp(-1i*2*pi*fltr(2)*p(1/(10e3*OSR))) ;
end
scatterplot(shiftf)
eyediagram(shiftf,32);
tp = repelem(seq2,OSR,1);
n_sequence = [tp;tp];
j1 = n_sequence;
mspeak = 0;

for i = -5*16:5*16
j2 = shiftf(max_time+i:length(j1)+i+max_time-1).';
ans = abs(j2'*j1);

if ans > mspeak
mspeak = ans;
indx_t = max_time+i;
end

end

new_fshift = shiftf(indx_t:indx_t+length1+length2+91*OSR-1);

down = downsample(new_fshift,OSR);
down = new_fshift(8:16:end);
scatterplot(down(2*length(seq2)+1:end))

chnl_com = [down(1:2*length(seq2))]./[seq2',seq2'];
chnl_mean = mean(chnl_com);

chnl_offset = [down(2*length(seq2)+1:end)]./chnl_mean;

scatterplot(chnl_offset);

for r1 = 1:length(chnl_offset)
if real(chnl_offset(r1))>0
offset_signl_(r1) =1;
else
offset_signl_(r1) = 0;
end
end
nshape = reshape(offset_signl_,[],7);
char_com = num2str(nshape);
char_2 = bin2dec(char_com);
char(char_2)
evm_error = 0;
for i = 1:length(chnl_offset)
if real(chnl_offset) >= 0
evm_f(i) = ((real(chnl_offset(i))-1).^2 + imag(chnl_offset(i)).^2);
else
evm_f(i) = ((real(chnl_offset(i))+1).^2 + imag(chnl_offset(i)).^2);
end

end

power_1 = mean(abs(chnl_offset).^2);

EVM = sqrt(sum(evm_f)/(length(chnl_offset)*power_1));
Posted
Comments
Richard Deeming 3-May-23 4:41am    
And?

A copy of your homework assignment and an unformatted, unexplained code-dump is not a question.

You need to explain precisely what the problem is, what you have tried, and where you are stuck.

Remember, nobody here is going to do your homework for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900