How to shrink time scale for discrete signal?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
%if
bits = [1,0,1,1,0,0,0,1];
% Mapping
for a=1:length(bits)
if bits(a) == 1
bit(a) = 5;
else
bit(a) = -5;
end
end
i = 1;
t = 0:0.01:length(bits);
for b=1:length(t)
if t(b) <= i
y(b) = bit(i);
else
y(b) = bit(i);
i = i+1;
end
end
plot(t,y);
end
I am trying to change the duration of 1 bit from 1s to 1us and the scale would be 0 to 8us with a step of 1e-8. I am getting an error if I do it using this method and if I specify my own time scale it will only print the first value that goes from 0 to 1. Any ideas???
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!