Generate triangle input with curve edge
Ältere Kommentare anzeigen
Hello, Does anyone have an idea, how can I generate triangle wave input with curve edge. That's mean the edge is not sharp but smooth.

1 Kommentar
Walter Roberson
am 7 Jan. 2013
It is best to show a sample of your desired output.
Akzeptierte Antwort
Weitere Antworten (2)
Azzi Abdelmalek
am 7 Jan. 2013
fs=1000;
ts=1/fs
te=ts/30;
t=-ts/2:te:ts/2
y=(ts/2-abs(t))*fs*4-1
close,plot(t,y)
1 Kommentar
K
am 7 Jan. 2013
bym
am 8 Jan. 2013
you can use the answer to this question http://www.mathworks.com/matlabcentral/answers/57604-help-with-plotting-triangular-wave and just use fewer terms for example:
clc;clear;close all
t = linspace(0,pi);
x = zeros(3,100);
c = 0;
terms = [1,3,5];
for m = terms
c = c+1;
n = (1:2:2*m-1);
for k=n
x(c,:) = x(c,:)+cos(k.*pi.*t)./k.^2;
end
end
plot(t,x)
Kategorien
Mehr zu Spectral Estimation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!