Fortune Telling Collection - Zodiac Analysis - Solve the following matlab program!
Solve the following matlab program!
Chromaticity control center
clear
SNR _ DB = 0: 1: 12;
sum = 1000000;
data= randsrc(sum,2,[0 1]);
[a 1,b 1]=find(data(:, 1)= = 0 & amp; Data (:,2) = = 0);
Message (a1) =-1-1i;
[a2,b2]=find(data(:, 1)= 0 & amp; Data (:,2) = =1);
Message (A2) =-1+1i;
find(data(:, 1)= = 1 & amp; Data (:,2) = = 0);
Message (a3) =1-1i;
[a4,b4]=find(data(:, 1)= = 1 & amp; Data (:,2) = =1);
Message (A4) =1+1i;
Scatter chart (message)
Title ("Point B Signal Constellation")
a = 1;
TB = 1;
Eb = A * A * Tb
p _ signal = Eb/Tb;
No =Eb. /( 10.^(snr_db/ 10));
P _ noise = P _ signal * NO
sigma = sqrt(P _ noise);
For Eb_NO_id= 1: length (sigma)
noise 1 = sigma(Eb _ NO _ id)* randn( 1,sum);
noise 2 = sigma(Eb _ NO _ id)* randn( 1,sum);
Receive = message+noise1+noise 2 *1i;
% resum = 0;
% total = 0;
m 1 = find(angle(receive)& lt; =π/2 & amp; Angle (receiving) > 0);
remessage( 1,m 1)= 1+ 1i;
redata(m 1, 1)= 1;
redata(m 1,2)= 1;
m2= find( angle(receive)>π/2 & amp; Angle (reception) < = pi);
remessage( 1,m2)=- 1+ 1i;
redata(m2, 1)= 0;
redata(m2,2)= 1;
M3=find( angle(receive)>pi & amp angle (receive)< =-π/2);
remessage( 1,m3)=- 1- 1i;
redata(m3, 1)= 0;
redata(m3,2)= 0;
m4=find( angle(receive)>-π/2 & amp; Angle (reception) < = 0);
remessage( 1,M4)= 1- 1i;
redata(m4, 1)= 1;
redata(m4,2)= 0;
[resum,ratio 1]=symerr(data,redata);
pbit(Eb _ NO _ id)= resum/(sum * 2);
[total,ratio2]=symerr(message,re message);
PE(Eb _ NO _ id)= total/sum;
end
Scatter chart (receiving)
Title ("C Point Signal Constellation")
PE = 1-( 1- 1/2 * erfc(sqrt( 10。 ^(SNR_DB/ 10)/2))).^2;
pbit = 1/2 * erfc(sqrt( 10。 ^(snr_db/ 10)/2));
Figure (3)
Semilogarithm (SNR_DB, pe,': s', SNR_DB, Pe,'-*', SNR_DB, Pbit,' -o', SNR_DB, pbit,':+').
Legend ("QPSK simulation error rate", "QPSK theoretical error rate", "QPSK simulation error rate", "QPSK theoretical error rate")
Xlabel ("signal-to-noise ratio /dB")
Ylabel ("probability p")
Grid open
- Previous article:What are the three constellations of indifference?
- Next article:How is the wind direction of the constellation divided?
- Related articles
- Sister-in-law's love exists at all times, at home and abroad. How to get along with the villains of the zodiac?
- Can't bear to look straight! 12 constellation takes care of children in this way.
- Brief introduction of Chang Ying Tianjie in Longhu
- Never loved the constellation of easy life?
- Conquer Aries
- Three Fixed Constellations _ Three Fixed Constellations Pairing
- A constellation woman born with a lady temperament.
- Antique cartoon illustrations, beautiful pictures of works
- The real nine-tailed fox constellation girl
- The rising constellation of lunar calendar 5. 12 _ 6.5438+02 What is the rising constellation?