Calculate a sine & save as wave

Calculate a sine vector including harmonics. Save as wave file.
226 Downloads
Updated 29 Mar 2012

View License

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
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on File Name Construction in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

Provided some improvements in the script

1.0.0.0