How to get frequency of a wav file for per cycle in matlab?

1 回表示 (過去 30 日間)
Yasir Ali
Yasir Ali 2019 年 1 月 17 日
コメント済み: Yasir Ali 2019 年 1 月 18 日
hi everyone , I want to compare the voice of male and female and wants to find difference between them,
for example :frequency on per cycle , any suggestion? what to do ?how to do.

採用された回答

Image Analyst
Image Analyst 2019 年 1 月 17 日
If you have the Signal Processing Toolbox, try spectrogram() or pwelch().
Otherwise, try fft().
  3 件のコメント
Image Analyst
Image Analyst 2019 年 1 月 17 日
Start here:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 16;
% Read and plot signal.
[y, fs] = audioread('guitartune.wav');
subplot(2, 2, 1);
plot(y, 'b-');
grid on;
title('Audio Waveform', 'FontSize', fontSize);
xlabel('Index', 'FontSize', fontSize);
ylabel('Signal Amplitude', 'FontSize', fontSize);
% Compute and plot spectrogram
subplot(2, 2, 2);
spectrogram(y);
title('Spectrogram', 'FontSize', fontSize);
% Compute and plot power.
audioPower = pwelch(y);
subplot(2, 2, 3);
plot(audioPower, 'b-');
grid on;
xlim([0, 5000]);
title('P Welch Power', 'FontSize', fontSize);
xlabel('Frequency', 'FontSize', fontSize);
ylabel('Power', 'FontSize', fontSize);
% Compute and plot power.
pxx = periodogram(y);
subplot(2, 2, 4);
plot(pxx, 'b-');
grid on;
xlim([0, 5000]);
title('Periodogram', 'FontSize', fontSize);
xlabel('Frequency', 'FontSize', fontSize);
ylabel('Power', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0, 0.04, 1, 0.96]);
0001 Screenshot.png
Sorry I can't give you a full tutorial on signal analysis but this should get you started.
Yasir Ali
Yasir Ali 2019 年 1 月 18 日
thank u.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCode Generation and Deployment についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by