0% fanden dieses Dokument nützlich (0 Abstimmungen)
6 Ansichten25 Seiten

Simulation PDF

Das Dokument beschreibt die Simulation von Signal-Konstellationen für QAM und QPSK sowie die Detektionsschemata für ASK, FSK und BPSK unter Verwendung von MATLAB. Es enthält theoretische Erklärungen zu den Modulationstechniken, die erforderlichen Apparate und Beispielcodes zur Durchführung der Simulationen. Die Ergebnisse zeigen die erfolgreiche Durchführung der Simulationen und die Analyse der Modulationsschemata.

Hochgeladen von

sharonsarah25012006
Copyright
© All Rights Reserved
Wir nehmen die Rechte an Inhalten ernst. Wenn Sie vermuten, dass dies Ihr Inhalt ist, beanspruchen Sie ihn hier.
Verfügbare Formate
Als PDF herunterladen oder online auf Scribd lesen
0% fanden dieses Dokument nützlich (0 Abstimmungen)
6 Ansichten25 Seiten

Simulation PDF

Das Dokument beschreibt die Simulation von Signal-Konstellationen für QAM und QPSK sowie die Detektionsschemata für ASK, FSK und BPSK unter Verwendung von MATLAB. Es enthält theoretische Erklärungen zu den Modulationstechniken, die erforderlichen Apparate und Beispielcodes zur Durchführung der Simulationen. Die Ergebnisse zeigen die erfolgreiche Durchführung der Simulationen und die Analyse der Modulationsschemata.

Hochgeladen von

sharonsarah25012006
Copyright
© All Rights Reserved
Wir nehmen die Rechte an Inhalten ernst. Wenn Sie vermuten, dass dies Ihr Inhalt ist, beanspruchen Sie ihn hier.
Verfügbare Formate
Als PDF herunterladen oder online auf Scribd lesen
[Link] No: 7 SIMULATION OF SIGNAL CON: Date: 19-3: 24. AND QPSK USING MATLAB ON FOR QAM AIM: To simulate signal constellation for QAM (Quadrature amplitude modulation) and QPSK( Quadrature phase shift keying) using MATLAB and obtain output. APPARATUS REQUIRED: MATLAB Software THEORY: Constellation diagram: + Acconstellation diagram is a representation of a signal modulated by a digital modulation scheme such as quadrature amplitude modulation or phase-shift keying it displays the signal as a two-dimensional xy-plane scatter diagram in the complex plane at symbol sampling instants, QAM: \ Quadrature Amplitude Modulation, QAM is a form of modulation that is a combination of phase modulation and amplitude modulation. * The QAM scheme represents bits as points in a quadrant grid known as a constellation map. It is a graph of the phase and amplitude modulation points in a given modulation scheme. QPSK: * Quadrature Phase Shift Keying (QPSK) is a form of Phase Shift Keying in which two bits are modulated at once, selecting one of four possible carrier phase shifts (0, 90, 180, or 270 degrees). QPSK allows the signal to carry twice as much information as ordinary PSK using the same bandwidth, QPSK uses four points on the constellation diagram, equi-spaced around a circle, With four phases, QPSK can encode two bits per symbol. Code for QAM: data=randi({0 M-1],1,N); s=qammod(data,M); SNR=20; T=awgn(s,SNR, Massage Sign) ii, tH f=bit_rate; Tb=I/bit_rate; t=0:(Tb/1000):Tb; TxSig={l; for i=I:length(data) Tx=real(s(i))*cos(2* pi* f*t)-imag(s(i))*sin(2*pi* Pt); TxSig= [TxSig, Tx]; Y#ok end RxSig=awgn(TxSig,SNR, measured’); figure(1) subplot(3,1,1); stairs(data);grid minor;ylim(|-0,5,M-0.5]);xlim({0,N)); title’ Message Signal’); subplot(3,1,2); plot(TxSig);grid minor;title('16-QAM modulated signal’); xlim({0.N*10°3+N)); subplot(3,1,3); plot(TxSig);grid minor;title('16-QAM modulated signal with AWGN’); xlim({0,N*10°3+N]); scatterplot(r); grid minor; title(’‘Constellation Diagram of 16-QAM’); Code for QPSK: N=1024; M=4; data=randi([0 M-1],1,N); s=pskmod(data,M,pi/4); SNR=20; r=awgn(s,SNR, measured’); bit_rate=10,"3; f=bit_rate; Tb=I/bit_rate: t=0:(Tb/1000):Tb; TxSig=(]; for i=1:length(data) Tx=real(s(i))*cos(2*pi* f*t)-imag(s(i))* TxSig= [TxSig, Tx]; Yotok threshold; subplot: plot(t,modulated_signal); title(Modulated Signal’); xlabel('Time'); ylabel(‘Amplitude’); subplot(3, 1,2); plot(t,received_signal); title(Received Signal with Nois xlabel(Time’); ylabel(‘Amplitude’); subplot(3,1,3); plot(t,envelope); hold on; plot(t,threshold*ones(size(t)),"-~'); titleEnvelope Detection’); xlabel(‘Time’); : ylabel(’Amplitude! legend('Envelope’,'Threshold’); error_rate = sum(xor(data, detec (_data)) / length(data); disp(('Bit Error Rate; FSK CODE % Parameters m2str(error_rate)]); fe = 10; % Carrier frequency OUTPUT: Modulated Signal MV Received sional with Noise M WMS nN TN Amplitude Amplitude Local carter Signal cena OF 02 03 04 Time Demodulated Data Bit Value (0 or 1) 0 OF 02 5 38 = = Time 03 04 fs = 1000; % Sampling frequeney T= 1; % Total time duration 1 = 0:1/fs:T-1/fs; % Time vector ‘A= 1; % Amplitude of carrier signal data = randi({0 1}, 1, length(1)); % FSK Modulation £1 = 5; % Frequency for'0’ \ £2 = 15; % Frequency for'l' modulated_signal = A * cos(2*pi*fl*t+ 2*pi"(- fly*cumsum(data)/f5); % Additive White Gaussian Noise (AWGN) SNR_AB = 10; % Signal to Noise Ratio in dB SNR = 10°(SNR_dB/10); noise_power = 0.5/(SNR); % Noise power noise = sqrt(noise_power)*randn(size(t)); % Gaussian noise % Received Signal received_signal = modulated_signal + noise; > % Coherent Detection fl; A* cos(2 * pi * £ carrier * t); £ carrie carrie demod_signal = received_signal .* carrier; [b,a] = butter(6, 2 * f carrier / £8); demod_signal_filtered = filter(b, a,demod_signal); threshold = A/ 2; % Decision threshold reccived_data = demod_signal_filtered >thre subplot(4,1,1); plot(t, modulated_signal); title(Modulated Signal’); xlabel(‘Time'); ylabel(‘Amplitude’ od, —— 2 —————_—_ = i z = “HUM Ha AORTA ived_signal); title(Reccived Signal with Noise’); xlabel("Time'); ylabel(’Amplitude’); subplot(4,1,3); plot(t, carrier); title('Local Carrier Signal’); xlabel(‘Time'); ylabel(‘Amplitude’); subplot(4,1,4); plot(t, received_data, 'o'); title('Demodulated Data’); xlabel('Time’); ylabel(‘Bit Valuc (0 or 1)'); ylim({-0.2 1.2); error_rate = sum(xor(data, reccived_data)) / length(data); y disp({'Bit Error Ral BPSK CODE fe = 10; fs = 1000; T= 1; t=0:1/fs:T-I/fs; A = 1; data = randi((0 1], 1, length(t)); % Random binary data bpsk_signal = A * cos(2*pi*fe*t + pi*data); SNR_AB = 10; SNR = 10(SNR_dB/10); noise_power = 0.5/(SNR); num2str(error_rate)]); noise = sqrt(noise_power)*randn(size(t)); % Received Signal received_signal = bpsk_signal + noise; received_data = received_signal .* (A * 05(2*pi*fe*t)) > 0} subplot(4,1,1:2); plot(t, [bpsk_signat’ titleModulated Signal and Recéived Signal with Noise’); teceived_signal]); slabel(‘Time’); ylabel‘Amplitude’); legend(’Modulated Signal’, ‘Received Signal with Noise’); subplot(4,1,3); plot(t, A * cos(2*pi* fet); title Local Carrier Signal’); xtabel(Time’); ylabel(‘Amplitude’); subplot(4,1,4); plot(t, reccived_data, 'o'); title((Demodulated Data’); xlabel(‘Time’); ylabel(‘Bit Value (0 or 1)'); ylim({-0.2 1.2); error_rate = sum(xor(data, received_data)) / length(data) disp({"Bit Error Rate: ', num2str(error_tate)}); AIM & PROCEDURE CODING VIVA A A \ crated using MATLAB. RESULT: Thus the ASK,FSK and BP, K detection schemes was gen [Link] Date: 24-24 COMMUNICATION LINK SIMULATION USING MATLAB AIM: ‘To Generate communication link simulation using MATLAB. APPARATUS REQUIRED: MATLAB software THEORY: + Simulate link-level models of communications systems, Use bit error rate simulations to analyze system response to the noise and interference inherent in communication channels, explore hypothetical scenatios, and evaluate the tradeoffs between competing system architectures and parameters, * Demodulation is performed to retrieve the transmitted data. Finally, the original and received signals are plotted to visualize the effect of noise on the transmission... COMMUNICATION LINK CODE: % % Communication Link Simulation % Parameters SNR_AB fe = 1e6; % Carrier frequency in Hz ; % Signal-to-noise ratio in dB Fs = 10¢6; % Sampling frequency in Hz T= I/Fs; % Sampling period “:1-T; % Time vector for 1 second s(2*pi*fo*t); % Carrier signal SNR = 10°(SNR_dB/10); % Convert SNR from 4B to linear scale noise_power = 1/SN Noise power 05 Time (s) yl Received Signal 9 Generate random binary data gata = randi((0 1], 1, length(); % Modulation (BPSK) modulated_signal = 2*data - 1; % BPSK modulation % Transmission through AWGN channel received_signal = modulated_signal .* feos + sqrt(noise_power)*randn(size(t)); % AWGN channel % Demodulation demodulated_signal = received_signal .* feos; % BPSK demodulation % Plot original and received signals figure; subplot(2,1,1); plot(t, modulated_signal); title(Transmitted Signal’); xlabel(‘Time (s)'); ylabel(‘Amplitude’); subplot(2, 1,2); plot(t, demodulated_signal); title(Received Signal’); xlabel(‘Time (s)'); ylabel(‘Amplitude’); VIVA | CODING formed using MATLAB. RESULT: Thus the simulation of Co! nication Link generation was per aptNo: WD 5 pate: 16-4°24 ielteaaen: OF LINEAR BLOCK AND CYCLIC ERROR “ONT! = . : ROL CODING SCHEMES USING MATLAB AIM: T la ol ; ‘0 simulate of linear block and cyclic control error coding using MATLAB. APPARATUS REQUIRED: MATLAB software ‘THEORY: «Linear block codes: ____Itisone ofthe eror control coding, Linear codes means that sun of any two code vector gives another code vector. Also itis a systematic code. Block codes in which the message bits are transmitted in unaltered form are called systematic code «Cyclic code: It is a block code, where the circular shifts of each codeword gives another word that belongs to the code. They are error-correcting codes that have algebraic properties that are convenient for efficient error detection and correction. LINEAR BLOCK CODE: cle; clear; % Given generator matrix G=[1000111; 0100110; 0010101; 0001011; oie % Calculate code words k= size(G, 2); code_words = []; fori = 1:2%k u= zeros(1, k); for j aT OUTPUT: G-[Lo00TT O1OOT1O OOTOTOL 000101; C=rem(U"G,2); disp(C); 0 0 0 0 0 0 0 jtrom((ieDs °C) = DAK) w= else wi) =O end codewords = [eode_words; rem(u * G, 29} end », Calculate minimum weight w_min = min(sum(code_words(2:2%k, :))); disp(w_min); CYCLIC ERROR CONTROL CODE dlc: % Parameters n=7;% Code length k=4:% Number of message bits % Generate random message disp(MESSAGE'); m=randi({0 1], 2, k); % Randomly generate a messabe disp(m); % Generate generator matrix disp((GENERATOR MATRIX’), G=[1000111; 9100110; 0010101; / 000101 disp(G); “Encode message ouTruT: POLYNOMIAL, tors CODE VECTOR oororto o1rtrooo) ERROR, ooo1000 oo00100 RECEIVED MATRIX oorriio o1rroro)0lt DECODED RECEIVED VECTOR oo1ro0o tt) o1ri1ooot DECODED MBs yp VECTOR): “ol cc + 2); % Encode the mes + G, 2), % Encode the message using the generator matrix SS nose * eode)s Sno AGE}; ode * G's % Decode the received message ~ mod(decoded_msg, 2); ; AIM & PROCEDURE CODING VIVA A 4 \ RESULT; Thus the of linear block and a ‘or coding was generated using MATLAB. G f phn? pate 334 SIMULATION op NVOL Ys USING MQ TONAL ¢ Lag | OVING ¢ Me ; Ml To simul: jate the convoluti ‘Wlonal coding sch, Me usin, 8 MATL, AB TUS REQUIRED: pra MATLAB software eORY: other type of error-correcting code whe jis ane” as re th resforming & desited logical operation on a peal bits a ee itstre tonsidering some bits of the previous stream. This colin along with ng technique rather than ing on the block of bits shows de ig Pendency on bits stream, Te Obtained by depend coNVOLUTIONAL CODE: gl=[101];% 1+ D*2 gel} 11;%1+D+D%2 % Message to encode message =[1 0110101); % Example message % Convolutional encoding ; encoded_message = conv_encader(message, G1, G2); disp('Encoded message:"); disp(encoded_message); function encoded_message = Son encoder(message, G1, G2) State = [0 0]: % Initial ‘Initialize encoded message ee ouTrUT: >> convolutionall message: Encoded rough 6 Columns 1 th 1 1. @ Columns 7 through 12 1 8 a Q Columns 13 through 16 0 a @ 8 noe mess pengthmessage) fort 1 = message(s japat bi shift 8 = |input_bit state} qoadedd bit_E = mods um(shift_reg.* GD), sed bit_ 2 = mod(sunn(shitt_ reg * G2), ence state = finpat_bit state(1)]; sncoded_ message = encoded _messiye encoded bit! encoded _bit 2 end end AIM & PROCEDURE schieie “anyones ws MATS AB RESULT: eT tional com “yhus thithe convol

Das könnte Ihnen auch gefallen