oussaki
Newbie level 3
hi to all,
I'm trying to write a matlab code for image transmission over a Rayleigh channel
my first question :is that true?
my second question :
I get an error in the instruction fl = filter (rayChan Obj, r)
please help me it's urgent
I'm trying to write a matlab code for image transmission over a Rayleigh channel
Code:
clear all;
clc;
sampleTime = 1/500000; % Sample time (s)
maxDopplerShift = 200; % Maximum Doppler shift of diffuse components (Hz)
delayVector = 1.0e-004 * [0 0.0400 0.0800 0.1200]; % Discrete delays of
% four-path channel (s)
gainVector = [0 -3 -6 -9]; % Average path gains (dB)
% Create Rayleigh channel object
rayChanObj = rayleighchan(sampleTime, maxDopplerShift, delayVector,...
gainVector)
rayChanObj.StoreHistory = 1; % Store channel state information as signal is
% processed for later visualization
myImage=imread('cameraman.tif');
[ligne colonne]=size(myImage)
figure(1);
imshow(myImage);
sigma = std2(myImage)
for i=1:500% applicate noise
x = randi(size(myImage, 1));
y = randi(size(myImage, 2));
myImage(x,y) = normrnd(myImage(x, y), sigma);
end
r=[];
for i=1:ligne
r=[r myImage(i,:)];% convert image to vector
end
fl=filter(rayChanObj,r) % applicate filter
tt=vec2mat(fl,colonne); % convert to matrix
figure(3);
imshow(tt); show the new image after transmission
my first question :is that true?
my second question :
I get an error in the instruction fl = filter (rayChan Obj, r)
Code:
Error in ==> channel.multipath.filterblock at 37
y = filter(chan.ChannelFilter, x, z);
Error in ==> channel.multipath.filter at 100
y(idx) = filterblock(chan, x(idx));