필터 지우기
필터 지우기

can anyone tell me what is wrong with this program?

조회 수: 1 (최근 30일)
fatma medhat
fatma medhat 2017년 4월 15일
댓글: GEEVARGHESE TITUS 2017년 4월 16일
clear all;
clc;
[y,fs,nbits]=wavread('fatmamedhat.wav');
sound(y,fs,nbits);
y=y(:,1);
fs=44100; %sampling frequency
FRAME_DURATION=0.03; %typical duration for frame
L=FRAME_DURATION*fs;
OVERLAPPED_DURATION=0.005; %overlapped duration
R=floor(OVERLAPPED_DURATION*fs);
X=buffer(y,L,R);
n=length(y);
t=(0:n-1)/fs; %times of sampling
%plotting the wave signal
subplot(2,1,1);
plot(t,y);
title('wave signal');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;
%calculating the energy signal
temp=0;
i=1:y;
temp=((y(i).^2+temp)>=0);
a=temp/10;
%plotting the energy of the wave file
subplot(2,1,2);
plot(i,a);
title('energy signal');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;

채택된 답변

GEEVARGHESE TITUS
GEEVARGHESE TITUS 2017년 4월 15일
1. Sound function generally takes in two arguments, but you have given three that includes nbits.
2. A for loop is missing, and should be based on the size/length of y
for i=1:length(y);% y is size Nx1
temp=((y(i).^2)>=0);
end
sum(temp)% total energy
  댓글 수: 4
fatma medhat
fatma medhat 2017년 4월 15일
i am still not getting the short-time energy plot !! what should i try ?
GEEVARGHESE TITUS
GEEVARGHESE TITUS 2017년 4월 16일
is your error still the same as shown in figure. If so it is because of line 4, change the format of function to
sound(y,fs);
If a different error is present send the snap.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by