필터 지우기
필터 지우기

Sampling frequency in Matlab

조회 수: 7 (최근 30일)
Md. Mahmudul Hasan Shihab
Md. Mahmudul Hasan Shihab 2020년 12월 9일
편집: Md. Mahmudul Hasan Shihab 2020년 12월 9일
clc;close all;clear all;
%%
[signal,Fs]=audioread('Dn-10.mp3');%Signal input
in mp3 format.
sound(signal,Fs);%Fs(sampling frequency)=44100Hz.
p=length(signal);
c=fft(signal,p);%Fourier transform.
y_n=abs(c);%Magnitude of the FFT.
Phase_c=unwrap(angle(c)); %Phase of the FFT.
x_n=((0:1/p:1-(1/p))*Fs);
w=phase(1:p/2); %Half range of phase of length of signal.
g_magnitude=abs(1:p/2); %Magnitude Spectrum of the signal.
figure(1)
plot(x_n,y_n);
xlabel('Given audio signal frequency in Hz');
ylabel('Given audio signal amplitude');
title('For the given audio signal of frequency response');
xlim([0,1100]); %Bounded the signal 0 to 1100Hz in X-axis.
p=max(y_n);%Find the max value of y_n signal.
q=(y_n==p(1));
r=find(q);
Frequency=x_n(r(1))%Finding corresponding frequency value.
if(Frequency>=100 && Frequency<=325)%The observed characteristic frequency
change for the signal.
disp('The given signal command is Wait.')
else
disp('The given signal command is Go.')
end
Here is simple matlab code to match a voice signal with its input voice signal. Can anyone explain how this code is working?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by