Message Boards Message Boards

0
|
4747 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

How to create monotone (periodic) sounds in Mathematica from function

Posted 9 years ago

Hello, I've discovered the function Play in Mathematica. I would like to generate sounds from functions defined on an interval and prolonged periodically (as the "saw tooth"). How could I do that? (, I tried some recursion definition of the function, but Play overstacked.)

(The question is how to define a periodically prolonged function in Mathematica without heavy recursions? or at least how to define a repeating sample for Play?)

Thank you

I wish you a nice day

POSTED BY: Marek Filan
4 Replies
Posted 9 years ago

One method is to use Mod to construct a periodic function:

f = Interpolation[{{0, 0}, {1, 1}, {2, 1}, {3, 0}}, 
  InterpolationOrder -> 1]

fperiodic[t_] := f[Mod[t, 3]]

Plot[fperiodic[t], {t, 0, 9}]
POSTED BY: David Keith
Posted 9 years ago

(i.e. create "copies" of the given interval)

POSTED BY: Marek Filan
Posted 9 years ago

This is not really what I am looking for, I would like to generate a general periodic function from a function given on an interval.

POSTED BY: Marek Filan

For the specific case of the "sawtooth", there is an example in the documentation for Play/Scope. I hope that is what you seek.

POSTED BY: Isaac Abraham
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract