tags: Signal processing matlab Digital signal processing
x = sawtooth(t,xmax)Generate a serrated sequence, there are two parameters, wherein the second parameter XMAX can be omitted.
This function cycle is 2 π 2\pi 2π, T is the time scale sequence, XMAX is a scale scaling coefficient, between 0 and 1, default is 1, the default amplitude is from -1 to +1 zigzag rising.
x = square(t,duty)Similar to the SawTooth function, the cycle is 2 π 2\pi 2π, T is a time scale sequence, and DUTY is a duty cycle.
The actual use code is as follows:
A = input('The peak value =');%Peak7
L = input('Length of sequence =');%Sequence length100
N = input('The period of sequence =');%Sequence repetition cycle13
FT = input('The desired sampling frequency =');%Sampling frequency20000
DC = input('The square wave duty cycle = ');%Waveform duty cycle60
% Create signals
T = 1/FT;%Sampling interval
n = 0:L-1;%Sequence serial number
x = A*sawtooth(2*pi*n/N);%A serrated wave generating cycle N
y = A*square(2*pi*(n/N),DC);%Production cycle is N, a square wave for duty cycle
% Plot
subplot(211)
stem(n,x);
ylabel('Amplitude');
xlabel(['Time in ',num2str(T),'sec']);
subplot(212)
stem(n,y);
ylabel('Amplitude');
xlabel(['Time in ',num2str(T),'sec']);
Results Map:

The above is a sawtooth wave, which is a square wave (digital sampling signal) amplitude is 6, duty cycle is 60%.
Article Directory C program gnuplot drawing matlab code matlab drawing C program gnuplot drawing matlab code matlab drawing...
1 Square function - generate cycle square wave signal Call format: y = a * square (t, w); The periodic square wave signal used to generate a period of T, amplitude is ± a, where parameter w rep...
Generating an amplitude of [-1, 1] using Matlab, period is 2 * pi (corresponding frequency is 1 / (2 * pi)), the time is 10 seconds, the time interval is 0.01 second waveform Detailed steps to generat...
Pulse Width Modulation (PWM) is the abbreviation of "Pulse Width Modulation" in English, which is called pulse width modulation. A very efficient technique for controlling the analog circuit...
1 Introduction GD32L233C uses a core of M23. This chip is said to be very low power consumption, to what extent? After we test it later, today we mainly test the DAC of the GD32L233C-Start. Since the ...
Matlab generates square wave pulses and periodic square wave signals Original link: Periodic rectangular wave (square wave) signal: It is represented by the square function in MATLAB, and its calling ...
Main program Generating system coordinate program The nearest neighbor Hamiltonian is the same as the previous program Fermi function ...
MATLAB-square function usage shorthand The sawtooth function is used to generate periodic sawtooth waves or triangle waves, and its calling syntax is as follows: 1.f=sawtooth(a*t): Generate a periodic...
Try to design an air -water heat exchanger needed to be used for an experimental platform. The design school nuclear calculation is implemented through Matlab, and the ax is positive!...
When zai used the canvas to draw graphics, he found that the display had some jaggedness and the visual effect was very bad. Can be used by using .translate(0.5, 0.5) in js Code: ...