Advertisement
omarosh

Signals Matlab

Jun 1st, 2021
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.42 KB | None | 0 0
  1. % Read audio file (Put sound.wav in the same folder as this .m file)
  2. [signal,fs] = audioread('sound.wav');
  3. %Audio signal is stored in (signal). While (fs) is the Sampling frequency
  4.  
  5. %To plot the signal in time domain
  6. figure;
  7. plot(sig);
  8. title('input audio signal in T domain');
  9.  
  10. %To play the audio file
  11. p=audioplayer(signal,fs);
  12. play(p);
  13.  
  14. %To save the signal into a new audio file
  15. audiowrite('sound.wav',signal,fs);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement