DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected]...

19
DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected] http://www.dcs.warwick.ac.uk/ ~feng/dsp.html
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    220
  • download

    1

Transcript of DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected]...

Page 1: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

DCSP-13

Jianfeng Feng

Department of Computer Science Warwick Univ., UK

[email protected]

http://www.dcs.warwick.ac.uk/~feng/dsp.html

Page 2: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Applications

• Power spectrum estimate

• Compression

Page 3: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

clear all

close all

sampling_rate=100; %Hz

omega=20; %signal frequecy Hz

N=10000; %total number of samples

for i=1:N

x_sound(i)=cos(2*pi*omega*i/sampling_rate); %signal

x(i)=cos(2*pi*omega*i/sampling_rate)+2*randn(1,1); %signal+noise

axis(i)=sampling_rate*i/N; % for psd

time(i)=i/sampling_rate; % for time trace

end

subplot(1,2,1)

plot(time,x); %signal + noise, time trace

xlabel('time (sec)');

ylabel('signal')

subplot(1,2,2)

plot(axis,abs(fft(x)).^2,'r'); % power of signal

xlabel('Frequency')

ylabel('Power')

sound(x_sound, sampling_rate); %true signal sound

Page 4: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

• Singnal processing demo: transformation

• A few words on Matlab

periodgram (fft)

pwelch (overlapped windows)

Page 5: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Power spectrum for white noiseNoise is a stochastic process x(t), for time t

(discrete or continuous)

Most noisy noise should have no memory, which impliese that

E x(t)x(t+s) = 0 if s is not zero

E x(t)x(t) = 1

or in another words

E x(t)x(t+s) =d(s)

Page 6: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Therefore the psd of the white noise is flat: it has constant power for all frequencies, as confirmed in the previous matlabe example

Different from all meaningful signals we encount

Page 7: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Spectrogram

• A spectrogram is an image that shows how the power spectrum of a signal varies with time.

Page 8: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

0 500 1000 1500 2000 2500-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

Page 9: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Time

Frequenc

y

Page 10: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

• t=0:0.001:20; % 2 secs @ 1kHz sample rate• y=chirp(t,100,1,200,'q'); % Start @ 100Hz, cross 200Hz at t=1sec• spectrogram(y,128,120,128,1E3); % Display the spectrogram• title('Quadratic Chirp: start at 100Hz and cross 200Hz at t=1sec');• sound(y)

Page 11: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Compression

Page 12: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Sampling and reconstruction

The question we consider here is under what conditions we can completely reconstruct the original signal

x(t)

from its discretely sampled signal

x(n).

Page 13: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.
Page 14: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

The use in MP3 is designed to greatly reduce the amount of data required to represent the audio recording and still sound like a faithful reproduction of the original uncompressed audio for most listeners.

Page 15: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

The use in MP3 is designed to greatly reduce the amount of data required to represent the audio recording and still sound like a faithful reproduction of the original uncompressed audio for most listeners.

An MP3 file could result in a file that is about 1/11th the size of the file created from the original audio source.

Page 16: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

The compression works by reducing accuracy of certain parts of sound that are deemed beyond the auditory resolution ability of most people.

Page 17: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

The compression works by reducing accuracy of certain parts of sound that are deemed beyond the auditory resolution ability of most people.

This method is commonly referred to as perceptual coding.

Page 18: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

The compression works by reducing accuracy of certain parts of sound that are deemed beyond the auditory resolution ability of most people.

This method is commonly referred to as perceptual coding.

It internally provides a representation of sound within a short-term time/frequency analysis window, by using psychoacoustic models to discard or reduce precision of components less audible to human hearing, and recording the remaining information in an efficient manner.

Page 19: DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

This technique is often presented as relatively conceptually similar to the principles used by JPEG, an image compression format.