Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclearness regarding the DC-offset in PeriodicWave #2530

Open
dd-pardal opened this issue Nov 29, 2022 · 3 comments
Open

Unclearness regarding the DC-offset in PeriodicWave #2530

dd-pardal opened this issue Nov 29, 2022 · 3 comments
Assignees
Labels
category: editorial Editorial changes that do not affect interpretation. https://www.w3.org/policies/process/#class-2 Needs Edits Decision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/ size: S Small amount of work expected to resolve.

Comments

@dd-pardal
Copy link

dd-pardal commented Nov 29, 2022

Describe the issue

Section 1.28.3.1 states that the element of the [[real]] array at index 0 is the DC-offset but the formula for the waveform in section 1.28.4 doesn't depend on it. Is this value being purposefully ignored? If so, adding a note about it in the spec would be helpful.

Where Is It

Section 1.28.

Additional Information

Firefox and Chromium seem to ignore this value.

@mdjp mdjp added the category: editorial Editorial changes that do not affect interpretation. https://www.w3.org/policies/process/#class-2 label Feb 23, 2023
@padenot
Copy link
Member

padenot commented Feb 23, 2023

If I remember correctly, being able to DC-offset is intended, back when the PeriodicWave object was not really specified. We when wrote the formula, but must have made a mistake there, dropping the DC-offset part.

Chrome and Firefox currently ignore the value (specifically, set the first real and imaginary coefficient to 0 before doing the inverse Fourier transform), but could use it.

It seems somewhat useful for control signal at least (where there's no dynamic range concerns, and can go outside of [-1.0, 1.0]).

@hoch hoch added the Needs Edits Decision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/ label Aug 10, 2023
@padenot
Copy link
Member

padenot commented Aug 10, 2023

This is correctly specified in https://webaudio.github.io/web-audio-api/#PeriodicWave-constructors (step 3.), and we can't change it now. Authors can use the ConstantSourceNode to add a DC-offset, and we'll change the spec text to make it clear that this cannot produce a DC-Offset.

@padenot padenot self-assigned this Aug 10, 2023
@mjwilson-google mjwilson-google added the size: S Small amount of work expected to resolve. label Sep 24, 2024
@hoch
Copy link
Member

hoch commented Sep 25, 2024

TPAC 2024:

In 1.28.3.1. Dictionary PeriodicWaveOptions Members, we can modify to clarify this point:

The real parameter represents an array of cosine terms. The first element (index 0) is the DC-offset of the periodic waveform. The second element (index 1) represents the fundmental frequency. The third represents the first overtone and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: editorial Editorial changes that do not affect interpretation. https://www.w3.org/policies/process/#class-2 Needs Edits Decision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/ size: S Small amount of work expected to resolve.
Projects
None yet
Development

No branches or pull requests

5 participants