Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

QPSK

D b

= 16; = exp(j*pi/4)*[-0.7 1];

% Number of samples of delay % Numerator coefficients of

channel a = [1 -0.7]; % Denominator coefficients of

channel ntr= 1000; s % Number of iterations

= sign(randn(1,ntr+D)) + j*sign(randn(1,ntr+D));% Baseband % QPSK signal

= 0.1*(randn(1,ntr+D) + j*randn(1,ntr+D));

% Noise

signal r x d = filter(b,a,s)+n; = r(1+D:ntr+D); = s(1:ntr); % Received signal % Input signal (received signal) % Desired signal (delayed QPSK

signal) L = 32; % filter length % Step size

mu = 0.01; ha = adaptfilt.tdafdft(L,mu); [y,e] = filter(ha,x,d);

subplot(2,2,1); plot(1:ntr,real([d;y;e])); title('In-Phase Components'); legend('Desired','Output','Error'); xlabel('Time Index'); ylabel('Signal Value'); subplot(2,2,2); plot(1:ntr,imag([d;y;e])); title('Quadrature Components'); legend('Desired','Output','Error'); xlabel('Time Index'); ylabel('Signal Value'); subplot(2,2,3); plot(x(ntr-100:ntr),'.'); axis([-3 3 -3 3]); title('Received Signal Scatter Plot'); axis('square'); xlabel('Real[x]'); ylabel('Imag[x]'); grid on;

subplot(2,2,4); plot(y(ntr-100:ntr),'.'); axis([-3 3 -3 3]); title('Equalized Signal Scatter Plot'); axis('square'); xlabel('Real[y]'); ylabel('Imag[y]'); grid on;

FIR FILTER

x b n d N

= randn(1,500); = fir1(31,0.5);

% Input to the filter % FIR system to be identified

= 0.1*randn(1,500); % Observation noise signal = filter(b,1,x)+n; = 31; % Desired signal % Adaptive filter order % RLS forgetting factor % Soft-constrained % initialization factor

lam = 0.99; del = 0.1;

ha = adaptfilt.ftf(32,lam,del); [y,e] = filter(ha,x,d); subplot(2,1,1); plot(1:500,[d;y;e]); title('System Identification of an FIR Filter'); legend('Desired','Output','Error'); xlabel('Time Index'); ylabel('signal value'); subplot(2,1,2); stem([b.',ha.Coefficients.']); legend('Actual','Estimated');

xlabel('coefficient #'); ylabel('Coefficient Value'); grid on;

dwt
clc; clear all; close all; % Read Images I1=imread('circuit.tif'); %I1=rgb2gray(I); figure(1); subplot(1,5,1); imshow(I1); title('original image'); I1=double(I1); [LL LH HL HH]=dwt2(I1,'haar'); I2=uint8([LL LH ;HL HH]); figure(1); subplot(1,5,2); imshow(I2); title('1 level image'); LL=double(LL); [LL1 LH1 HL1 HH1]=dwt2(LL,'haar'); I3=uint8([LL1 LH1 ;HL1 HH1]); figure(1); subplot(1,5,3); imshow(I3); title('2 level image'); LL=double(LL1); [LL2 LH2 HL2 HH2]=dwt2(LL1,'haar'); I4=uint8([LL2 LH2 ;HL2 HH2]); figure(1); subplot(1,5,4); imshow(I4); title('3 level image'); LL=double(LL2); [LL3 LH3 HL3 HH3]=dwt2(LL2,'haar'); I5=uint8([LL3 LH3 ;HL3 HH3]); figure(1); subplot(1,5,5); imshow(I5);

title('4 level image');

You might also like