• Sonuç bulunamadı

APPENDIX B pspectrum.m

N/A
N/A
Protected

Academic year: 2021

Share "APPENDIX B pspectrum.m"

Copied!
2
0
0

Yükleniyor.... (view fulltext now)

Tam metin

(1)

123

APPENDIX B

pspectrum.m

% % FUNCTION pspectrum %

% Display the sound power spectrum (in linear and logarithmic scales) % function r = pspectrum(s, fs) l = length(s); m = 100; n = 256; nbFrame = floor((l - n) / m ) + 1; %

% Create a matrix M containg all the frames % for i = 1:n for j = 1:nbFrame M(i, j) = s(((j - 1) * m) + i); end end %

% Matrix M created. Now apply HAMMING window and store in matrix N. Column vectors of N are

% the original frame vectors transformed by the Hamming window filter %

h = hamming(n); N = diag(h) * M;

%

% Now apply FFT and create a new matrix M2 where the column vectors are the FFTs of the

% column vectors of N. The elements of column matrix M2 contain the frames of the original

% signal, filtered by the Hamming window and transformed with the FFT. The elements of M2

% are complex numbers and symmetrical because FFT was used to transform the data.

%

% Each column in M2 is a power spectrum of the original signal %

for i = 1:nbFrame

M2(:,i) = fft(N(:, i)); end

(2)

124

tm = length(s) / fs; subplot(121);

imagesc([0 tm], [0 fs/2], abs(M2(1:t, :)).^2), axis xy; title('Power spectrum (Linear)');

xlabel('Time [s]');

ylabel('Frequency [Hz]'); colorbar;

subplot(122);

imagesc([0 tm], [0 fs/2], 20*log10(abs(M2(1:t, :)).^2)), axis xy; title('Power spectrum (Logarithmic)');

xlabel('Time [s]');

ylabel('Frequency [Hz]'); colorbar;

r=1;

%

% END OF FUNCTION pspectrum %

Referanslar

Benzer Belgeler

In domestic legal science is absent the theoretical understanding of what elements compose state government and how among them are expressed atypical ones, how

yüzyıl’ın en önemli düşünürlerinden Walter Benjamin’in çığır açan “Tekniğin Olanaklarıyla Yeniden Üretilebildiği Çağda Sanat Yapıtı” adlı eseri

Because of the dilation up to the appendix stem, appendectomy with partial resection of the cecum was performed (Figure 4).. The patient was discharged on the fifth postoperative

function edit5_Callback(hObject, eventdata, handles) function pushbutton2_Callback(hObject, eventdata, handles) data = getappdata(gcbf,

The elements of column matrix M2 contain the frames of the original... 128 % signal, filtered by the Hamming window and transformed with

In conclusion, using stocks traded at Borsa İstanbul for during January 2002 to December 2014, it is concluded that there is statistically significant and negative effect of

First, advertisers are opting to place their ads in only one or two newspapers for any one specific time period, usually one Arabic language daily and/or one English language

Tablo 4.11’de görüldüğü gibi öğretmenler kendi okul müdürlerinin eşgüdümleme sürecine ilişkin “Öğrencilerin okula devamını sağlamak amacıyla