How does MATLAB code square wave fiter?

조회 수: 7 (최근 30일)
DongShin Yang
DongShin Yang 2016년 1월 21일
편집: DongShin Yang 2016년 1월 21일
%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?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by