dasp icon indicating copy to clipboard operation
dasp copied to clipboard

Offset phase in Signal

Open viktaur opened this issue 1 year ago • 2 comments

Hi, is it currently possible to offset the phase of a Signal (in dasp_signal)?

For example, when defining a sine wave, how could I displace it by x rad? signal::rate(sample_rate).const_hz(freq).sine()

If this has not yet been implemented, I'm happy to start a PR.

viktaur avatar Jan 16 '24 18:01 viktaur

I tried using Phase.next_phase_wrapped_to to accomplish this, but for some reason I could not get any signals created with the offset phase to generate anything but silence. I would love to see this supported!

Smona avatar Feb 12 '24 09:02 Smona

I have started a PR #183

viktaur avatar Feb 27 '24 00:02 viktaur