Umal-qura university



Yüklə 0,73 Mb.
səhifə25/30
tarix23.12.2023
ölçüsü0,73 Mb.
#156716
1   ...   22   23   24   25   26   27   28   29   30
Signal and Systems Manual - v2full

Signal Flipping

clear n=‐1:1/1000:1;


x1=5*sin(2*pi*1*n);
subplot(2,1,1);
plot(n,x1, 'g', 'linewidth',2);
axis([‐1 1 ‐5 5]);
xlabel('time'); ylabel('signal amplitude');
title('Original sine wave'); grid;

subplot(2,1,2);


plot(‐n,x1, 'r', 'linewidth',2); axis([‐1 1 ‐5 5]);
xlabel('time'); ylabel('signal amplitude'); title('Flipped sine wave'); grid;




      1. Amplitude Scaling

clear n=1:7;


x=[1 2 2 3 2 2 1];
subplot(2,1,1);
stem(n,x, 'filled'); title('Original signal'); xlabel('Time index'); ylabel('Signal Amplitude'); axis([1 7 0 4]);
grid;
S=2;
subplot(2,1,2);
stem(n,S*x, 'filled'); title('Amplitude Scaled signal'); xlabel('Time index'); ylabel('Signal Amplitude'); axis([1 7 0 8]); grid;




Task 6
Scale the continuous‐time sinusoid used in signal shifting example by a factor of 2.



      1. Time Scaling

%Decimation (down‐


sampling) clear

n=‐2:1/1000:2;


x1=sin(2*pi*2*n); x2=decimate(x1,2);

subplot(2,1,1); plot(x1); title('Original signal');


xlabel('Sample Number'); ylabel('Signal Amplitude');
axis([0 4000 ‐1
1]); grid;

subplot(2,1,2);


plot(x2); title('Decimated signal'); xlabel('Sample Number'); ylabel('Signal Amplitude'); axis([0 2000
‐1 1]);
grid;


Task 2


Use interp command in the above program to interpolate (up‐sample) the signal by a factor of 2.
Laboratory Manual


      1. Yüklə 0,73 Mb.

        Dostları ilə paylaş:
1   ...   22   23   24   25   26   27   28   29   30




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə