IPB

Welcome Guest ( Log In | Register )

fft filtering code, i have no idea
mikrophun
post Nov 10 2011, 11:29
Post #1





Group: Members
Posts: 2
Joined: 10-November 11
Member No.: 95073



hi all,
is there anyone can help me to read the code below:
(i really don't understand about matlab programming)

clear all;
clc;

[a,fs] = wavread('msrnbng2.wav');
x1 = length(a)
sr = a(1:2500000);
x1 = length(sr)

dw = 8192;
skala = fs/dw;

%saron1
mi1 = int16(500/skala);
ma1 = int16(540/skala);
%saron2
mi2 = int16(688/skala);
ma2 = int16(720/skala);
%saron3
mi3 = int16(780/skala);
ma3 = int16(830/skala);
%saron5
mi5 = int16(890/skala);
ma5 = int16(920/skala);
%saron6
mi6 = int16(950/skala);
ma6 = int16(970/skala);
%saron1'
mi1t = int16(1008/skala);
ma1t = int16(1078/skala);

beng=[] %menyimpan matrix2, variable matrix digunakan untuk menampilkan hasil 3D
aw=1 %dimulai dari 1. digunakan untuk perulangan.
dd1=400; %panjang sinyal yang mau diambil

while aw<= (length(sr)-dw) %while aw <=(2500000-8192)
ass = sr(aw:dw+aw); %ass = sr (aw:8192+aw)
ff1 = fft(ass); %b = fft(a(5000:10000),pnj);
beng=[beng (abs(ff1(1:dd1)))];
aw = aw + dw; %aw = aw + 8192;
end

figure(1)
mesh(beng) %menampilkan gambar 3D
xlabel('Times');
ylabel('Frekuensi');
zlabel('Amplitudo');
title('Perkiraan nada dalam bentuk 3D');

gambar1 = max(beng(mi1:ma1,:));
gambar2 = max(beng(mi2:ma2,:));
gambar3 = max(beng(mi3:ma3,:));
gambar5 = max(beng(mi5:ma5,:));
gambar6 = max(beng(mi6:ma6,:));
gambar7 = max(beng(mi1t:ma1t,:));
gambars = [gambar1;gambar2;gambar3;gambar5;gambar6;gambar7];
tampil = gambars'; %tampil = transpose dari gambars
pjg_tampil = length(tampil) %ukuran panjang tampil

figure(2);
plot (tampil);
xlabel('Times');
ylabel('Frekuensi');
legend('Saron 1','Saron 2','Saron 3','Saron 5','Saron 6','Saron 1t');
%axis([0,620,0,350]);
title('Perkiraan nada dalam bentuk 2D');

figure(3);
%plot (tampil);
%xlabel('Times');
%ylabel('Frekuensi');
%legend('Saron 1','Saron 2','Saron 3','Saron 5','Saron 6','Saron 1t');
%axis([200,400,0,350]);
%title('Perkiraan nada dalam bentuk 2D from times 200-400');

%figure(4);
%plot (sr), title('waveform of msrnbng2');
subplot(2,1,1), plot (a), title('waveform of msrnbng2');
subplot(2,1,2), plot (sr), title('waveform of msrnbng2 from 1 to 2500000');

This post has been edited by mikrophun: Nov 10 2011, 11:29
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th July 2014 - 07:29