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 (2026). Calculate a sine & save as wave (https://se.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 Filename Construction in Help Center and MATLAB Answers
Version Published Release Notes
1.1.0.0

Provided some improvements in the script

1.0.0.0