Calculate a sine & save as wave
Produce a sine vector including harmonics. Different intensities for harmonics are possible. Control duration and sample rate. Save sine vector as a wave file.
Intensities are weighted according to number of harmonics. Vector is normalized to a range of -1:1.
Variables:
frequency in Hertz [f0, f1, f2, etc.]
0 < intensity < 1 [i1, i2, i3, etc.]
duration in milliseconds
optional variables:
play = 'playon' / 'playoff'
save = 'saveyes' / 'saveno'
where_name = directory + name w/o '.wav'ending
Cite As
Fabian Tomaschek (2024). Calculate a sine & save as wave (https://www.mathworks.com/matlabcentral/fileexchange/35908-calculate-a-sine-save-as-wave), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.