1 / 14

L34: Noise and Signal

L34: Noise and Signal. Announcements. Away next Friday, the class will be taught by …. No office hours next Wednesday Assignment 4. Smoothing functions Audio processing Image processing. What does this code do?. t= linspace (0,2*pi,101); y=sin(t); y=sin(t)+0.1*(rand(size(t))-0.5);

Télécharger la présentation

L34: Noise and Signal

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. L34: Noise and Signal

  2. Announcements • Away next Friday, the class will be taught by …. • No office hours next Wednesday • Assignment 4

  3. Smoothing functions • Audio processing • Image processing

  4. What does this code do? t=linspace(0,2*pi,101); y=sin(t); y=sin(t)+0.1*(rand(size(t))-0.5); y_mod=y; for i=2:length(t)-1 y_mod(i)=(y(i-1)+y(i)+y(i+1))/3; end

  5. Noise vs Signal plots plot(t,y); hold on; plot(t,y_mod,’r’);

  6. Other ways of smoothing • Vector additions y_mod=y; y_mod(2:end-1)=(y(1:end-2)+y(2:end-1)+y(3:end))/3; • Convolution/Filtering y_mod=imfilter(y,[1 1 1]/3);

  7. What does this code do? t=linspace(0,2*pi,101); y=sin(t)+0.1*(rand(size(t))-0.5); y_mod=y; for i=2:length(t)-1 y_mod(i)=y(i)-y(i-1); end plot(t,y_mod);

  8. Other ways of doing the same thing • Vector minus y_mod=y; y_mod(2:end)=y(2:end)-y(1:end-1); • Convolution/Filtering y_mod=imfilter(y,[-1 1]);

  9. Takeaways • Averaging smoothens i.e. suppresses high frequency jitter • Differentiating amplifies noise i.e. suppresses low frequency signal

  10. Audio processing • Reading in a wav file • [audio_var,fs]=wavread(‘hootie.wav’); • Audio variables are just two column matrices: first column is the left channel and the second column is the right channel • Playing audio • soundsc(audio_var,fs); • soundsc(audio_var(:,1),fs); %plays left channel

  11. Vector operations on audio files left=audio_var(:,1); right=audio_var(:,2); plot(left) soundsc(left(end:-1:1,:),fs)

  12. Adding echo N=10000; left_echo=left; for i=N+1:length(left) left_echo=left(i)+left(i-N); end

  13. Removing vocals • Vocals are, in general, recorded on both the left and right channel. So…. • soundsc(left-right, fs)

  14. High frequency (noise) and low frequency (signal) • Suppressing high frequency (smoothing) left_smooth=imfilter(left,ones(10,1)); • Suppressing low frequency (differentiating) left_der=left(2:end)-left(1:end-1);

More Related