Search code examples
matlabplotsignalsgeometry

Plotting random signal on circle


I have some random signal (for example sin signal) with the time scale.

t=0:0.1:2*pi
y=sin(t)
plot(t,y)

Now I want to draw this signal on this circle. So the time vector actually becomes an envelope of the circle. Envelope of the circle represents "y = 0" in cartesian coordinate system.

Here is an example of what I expect the output to look like:
The example picture of what we want is on this link.
(source: slikomat.com)

Thank in advanced!


Solution

  • You need to add "noise" to the radius of the circle, roughly around r=1:

    th = linspace( 0, 2*pi, N ); %// N samples
    noise = rand( 1, N ) * .1; %// random noise in range [0..0.1]
    r = 1+noise; %// add noise to r=1
    figure;
    plot( r.*cos(th), r.*sin(th) ); title('noise on circle');
    

    An example plot would look like:
    enter image description here