how to reverse,scale and shift an acquired signal?

16 次查看(过去 30 天)
i want a concise code to perform simple operations on an acquired signal which is in cvv format.

采纳的回答

Aneesh Deshmukh
Aneesh Deshmukh 2018-4-7
编辑:Aneesh Deshmukh 2018-4-7
% 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%

更多回答(1 个)

syed fiaz
syed fiaz 2022-9-24
Time reversal property for DFT of matlab code

类别

Help CenterFile Exchange 中查找有关 Signal Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by