Facebook
From Scribby Sheep, 2 Months ago, written in Matlab M-file.
Embed
Download Paste or View Raw
Hits: 30
  1.  
  2. sin_params = [0.3 0 0.001; 0.5 0 0.002];
  3. sig = genSumSin(sin_params(:,1),sin_params(:,2),sin_params(:,3),1000);
  4.  
  5. [sig_sd,e] = sigmadelta(sig);
  6.  
  7.  
  8. hold on
  9.     plot(sig)
  10.     plot(sig_sd)
  11. hold off
  12.  
  13. % figure
  14. % plot(e)
  15.  
  16. % sig_rec - signal reconstruction
  17. for i = 1:1:length(sig_sd)
  18.     sig_rec(i) = sum(sig_sd(1:i));
  19. end
  20.  
  21. % skalowanie do podobnej amplitudy
  22. sig_rec = ( sig_rec - mean(sig_rec) )/length(sig_sd)*10;
  23.  
  24. hold on
  25.     plot(sig_rec)
  26.     plot(sig)
  27. hold off