MATLAB: How to reverse,scale and shift an acquired signal

@signalreversing#signalacquisition#signals processing#signalsandsystems#signalscaling#signalshifting#signalsproject

i want a concise code to perform simple operations on an acquired signal which is in cvv format.

Best Answer

% code
clc;
clear all;
close all;
s = xlsread('C:\Users\ADMIN\Desktop\DSO00001.csv');
x = s(:,1);
y = s(:,2);
x1 = 0;
y1 = 0;
c = 0;
disp('1)Time Scale:');
disp('2)Time Shift:');
disp('3)Time Reversal:');
disp('4)Scale,Shift and Reversal:');
while((c >=5 || c<=0))
c = input('Enter choice: ');
switch(c)
case 1
a = input('Enter Scaling factor: ');
x1 = x/a;
y1 = y;
case 2
b = input('Enter shifting factor: ');
x1 = (x-b);
y1 = y;
case 3
x1 = (-1)*x;
y1 = y;
case 4
a = input('Enter Scaling factor: ');
b = input('Enter shifting factor: ');
x1 = (-1)*(x-(b*a))/a;
y1 = y;
otherwise
disp('Invalid Input');
end
if(c>0 && c<5)
subplot(1,2,1)
plot(x,y)
xlabel('t')
ylabel('signal')
grid on
title('Original Signal:')
subplot(1,2,2)
plot(x1,y1)
xlabel('t')
ylabel('signal')
grid on
title('Resultant Signal:')
hold on;
end
end
%given below is the output for reversing%
Related Question