필터 지우기
필터 지우기

Use only a certain range of values for a function

조회 수: 1 (최근 30일)
Abdelrhman Abdelfatah
Abdelrhman Abdelfatah 2022년 5월 13일
댓글: Voss 2022년 5월 13일
Well, I do really have a simple question that i have been looking around for a good answer to.
I have a function z which is a result from convoluting an impulse repsone function h, and y taking from an audio signal.
[y,Fs] = audioread('Test1.wav');
%sound(y,Fs)
delay=0.8*Fs; %Delay
attenuation_factor=0.4;
h1=zeros(1,delay+1);%Impulse
h1(delay+1)=attenuation_factor; %Impulse at delay
h1(1)=1;
z=conv(y,h1); %Convolution
I want to limit the values of z to be only between 0 and 3 seconds; so i can output the sound and plot it later on.
-------
-------
subplot(4,1,2);
t_z=(0:numel(z)-1)/Fs;
plot(t_z,z)
ylabel('Orginal with Echo')
xlabel('time')
sound(z,Fs);
I have tried using Xlim and Xmax method, but couldnot figure it out the best
z(z < numel(Fs) |z > 0) = [];

채택된 답변

Voss
Voss 2022년 5월 13일
truncated_z = z(t_z <= 3);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by