Skip to content

How to create a rectangle Waveform? #69

Answered by ar1st0crat
icegh asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, does this code generate the waveform you need?

var samplingFrequency = 44100/*Hz*/;

DiscreteSignal signal = 
    new SquareWaveBuilder()
        .SetParameter("frequency", 432.0/*Hz*/)
        .SetParameter("min", -0.8)
        .SetParameter("max", 0.8)
        .OfDuration(4*60 + 16) // seconds
        .SampledAt(samplingFrequency)
        .Build();

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@icegh
Comment options

Answer selected by icegh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants