How does MATLAB code square wave fiter?

6 views (last 30 days)
DongShin Yang
DongShin Yang on 21 Jan 2016
Edited: DongShin Yang on 21 Jan 2016
%Transmitted signal is iidx
iidx = zeros(N0,1); % N0 is the number of code.
iidx = transpose(round(rand(1,N0))*2-1); %iidx of i.i.d.(independent and identically distributed)
Tk=(rand(1,k)*MaxDelay); %Tk is delay, MaxDelay is Maximum delay of Tk.
Tk=sort(Tk);
Ck=randn(1,k); % Ck is the value of Channel Impulse Response
%Raised Cosine filtering case: Raisd Cosine fitering Channel is hRCf.
Beta = 0.22; % Roll-off factor for the Raised Cosine filter.
ndashi = -10*Tc:Tc/J:(10*Tc+Tc/J*(L-1)); %ndashi is Time vector (sampling intervals, Tc = 1, J =1, L is delay.
Rck=zeros(0,length(ndashi));
for k = 1:K, % k is number of paths, K is maximum number of path.
ndashi = -10*Tc:Tc/J:(10*Tc+Tc/J*(L-1));
t = ndashi - Tk(k); % delay between 0 and 1
t = t+1e-10; %the denominator would be zero at t=0 (or manually set “Rcone(t=0)=1”)
Rcone = (sin(pi*t/T)./(pi*t/T)).*(cos(Beta*pi*t/T)./(1-(2*Beta*t/T).^2)); %Raised Cosine filter
Rck = [Rck; Rcone]; % Raised-Cosine FIR filter
end
hRCf = Ck * Rck; %
Now, I want to change Raised cosine fiter to square wave fiter?
How can I make the square wave fiter such as sampling intervals of Raised Cosine fiter?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!