Periodically repeating exponential function
Show older comments
Hi! I am trying to design a trapezoidal filter in Matlab by generating a periodically decaying exponential signal that we get from the pre-amplifier. Can someone help me with the code to generate this type of periodic signal?
Accepted Answer
More Answers (1)
Scott Sands
on 10 Nov 2018
Edited: madhan ravi
on 10 Nov 2018
try using mod() rather than repmat for greater flexibility:
%setup:
Twave=50;
T=100;
Fs = 1;
dt = 1/Fs;
Time = (-T:dt:T-dt)';
tau=20;
%generate periodic exponential "v", scaled 0-1:
v = 1/(1-exp(-Twave/tau))*(1*exp(-mod(Time,Twave)/tau) - exp(-Twave/tau));
figure(1);
clf(1);
plot(Time,v);
Categories
Find more on Matched Filter and Ambiguity Function in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!