Skip to content

Instantly share code, notes, and snippets.

@HsuChiChen
Created July 23, 2022 05:11
Show Gist options
  • Select an option

  • Save HsuChiChen/0a4febbba04cef17d6b201e21f631e0a to your computer and use it in GitHub Desktop.

Select an option

Save HsuChiChen/0a4febbba04cef17d6b201e21f631e0a to your computer and use it in GitHub Desktop.

Revisions

  1. HsuChiChen created this gist Jul 23, 2022.
    17 changes: 17 additions & 0 deletions dial.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    % dial
    N = 8192*0.5;
    n = 0:N-1;
    x = 0.5*n/N;
    y1 = sin(2*pi*697*x)+sin(2*pi*1209*x);
    y2 = sin(2*pi*697*x)+sin(2*pi*1336*x);
    y3 = sin(2*pi*697*x)+sin(2*pi*1477*x);
    y4 = sin(2*pi*770*x)+sin(2*pi*1209*x);
    y5 = sin(2*pi*770*x)+sin(2*pi*1336*x);
    y6 = sin(2*pi*770*x)+sin(2*pi*1477*x);
    y7 = sin(2*pi*697*x)+sin(2*pi*1209*x);
    y8 = sin(2*pi*941*x)+sin(2*pi*1336*x);
    y9 = sin(2*pi*697*x)+sin(2*pi*1477*x);
    y0 = sin(2*pi*941*x)+sin(2*pi*1336*x);

    z = zeros(1,512); % space
    sound([y5 z y0 z y1 z y2 z y0])