1

I use Ubuntu 22.04. Is there an application for converting mathematical periodical sin/cos formula (functions) to sound? For example is there a way for playing these signals:

  • cos(2π · 440 t)
  • cos t + cos 2^(1/2) t

Features:

  • I only look for free applications.
  • I prefer a desktop application; but a simple web application is also acceptable.

Note:

  • I have installed FFmpeg and Octave on my machine.
  • A web page which describes the way of using those for my purpose is acceptable.
1
  • In MATLAB, there is sound. Is there an equivalent function in Octave? Commented May 13, 2023 at 13:13

1 Answer 1

0

Starting with Octave 5, you can use audiowrite (older versions used wavwrite) as listed here:

https://docs.octave.org/v5.2.0/Audio-File-Utilities.html#index-audiowrite

The first formula cos(2π · 440 t) can be exported into a WAV like this:

octave:1> fs = 44100;                           % set the sample rate in Hz
octave:2> data = cos(2*pi * 440 * (1:fs) / fs); % create the data
octave:3> audiowrite('cosinus.wav', data, fs);  % save data as wav file

Maybe something similar is possible for your second formula.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.