How to programe clipping sine wave
22 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
TIME =linspace(0,6*pi,200)
SignalVoltage = 7*sin(Time)
0 commentaires
Réponse acceptée
Sam Chak
le 2 Août 2022
Modifié(e) : Sam Chak
le 2 Août 2022
Hi @Mvana
Cannot open your jpg (I'm lazy to fix the link). If you study Pure Math in high school, you need to use the sign function to clip the signal. But in MATLAB, it's a pretty easy job do something like this. In Electrical Engineering, you can use the Diode Clipper circuit.
% original sine wave
t = linspace(0, 6*pi, 3600*3+1);
x = 7*sin(t);
plot(t, x, 'linewidth', 1.5), hold on
% clipped sine wave
ub = 4; % upper bound
lb = -4; % lower bound
y = max(lb, min(x, ub));
plot(t, y, 'linewidth', 1.5), hold off
grid on, xlabel('t'), ylabel('x(t)'), ylim([-10 10])
2 commentaires
Plus de réponses (2)
Mbongeni
le 8 Août 2022
how do i use the end function? i have a row by column vector and matlab instructions say that i must use the end command,but it gives me an error when i try it. What can i do to solve this problem?
Munyaradzi
le 28 Avr 2024
Time= linspace(0,6*pi,200)
y= 7*sin(Time)
y(y<-5) = -5
y(y>5) = 5
signalVoltage=y
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!