Facebook
From bartek, 5 Years ago, written in Plain Text.
This paste is a reply to Untitled from bartek - view diff
Embed
Download Paste or View Raw
Hits: 376
  1. clc;
  2. clear all;
  3. close all;
  4.  
  5. fpr=44100;
  6. Nx=4*fpr;
  7. dt=1/fpr;
  8. fm=1;
  9. t=dt*(0:Nx-1);
  10.  
  11. f0=0;
  12. df=1000;
  13. fch1=f0+df*t;
  14. f0=2000;
  15. df=2000;
  16.  
  17. fch2=f0+df*sin(2*pi*fm*t);
  18. f0=100;
  19. df=0;
  20.  
  21. fch3=f0*exp(2*t);
  22.  
  23. fch=fch1;
  24.  
  25. HEHE NIEDIZOA
  26.  
  27. if(0)
  28. x=sin(2*pi*cumsum(fch)*dt);
  29.  
  30. plot(t,x); pause
  31. spectrogram (x, 512, 512-32, 1024, fpr);
  32. soundsc(x,fpr)
  33. end
  34.  
  35. if(1)
  36. f0=1;
  37. for k=0:10
  38.     x=cos(2*pi*(f0+k*fpr)*t) +k/10;
  39.     plot(t,x); hold on;
  40.    
  41. end
  42. end