Create a Square Wave function without using the Matlab function square.
Show older comments
Hello! I would love to learn how to make a Square wave funtion to generate a unit amplitude with a 440 Hz square wave. A duty cycle of 0.2, 0.5 and 0.8, that last for 2 seconds. Using a sampling frequency of 44.1kHz.
Inputs are:
- Duty-cycle
- Total time for which the square wave is defined
- Sampling Frequency
- Fundamental frequency
OUTPUT:
- Square Waveform
All I have done
function [waveform] =SqWave(DutyC,Tt,Fs,Ff)
DutyC = 0.2;
Fs = 44100;
Further work : I will keep researching and find a solution but in the mean time I would like to hear feedback.
Answers (0)
Categories
Find more on Waveform Generation 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!