Create a Square Wave function without using the Matlab function square.
9 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!