relationship between a frequency, frequency rate and time for good graph and good sound

1 回表示 (過去 30 日間)
Joel Sande
Joel Sande 2015 年 7 月 17 日
コメント済み: Joel Sande 2015 年 7 月 29 日
function Sound_and_Draw_Signal_Over_Time( frequency, intensity, time )
%UNTITLED2 Summary of this function goes here %Detailed explanation goes here
fs = 80 * frequency;
%fs = 8000;
%%% TRY THIS Sound_and_Draw_Signal_Over_Time( 100, 5, 5 )
%%% to make this function work very well, I need to know
%%% what is the good relationship between a frequency and
%%% its corresponding frequency rate
t = 0:(1/fs): time;
y = intensity * sin (2 * pi * frequency * t);
figure
plot(fs*t(1:frequency),y(1:frequency));
title(['Signal of ', num2str(frequency) ,' Hz frequency']);
xlabel('time (milliseconds)')
ylabel('amplitude');
sound(y, fs);
end
  1 件のコメント
Joel Sande
Joel Sande 2015 年 7 月 29 日
% The Over sampling rate will be in good range if you call this
% function I just wrote.
function [Over_Sam_Rate] = F_frequency(frequency)
if (frequency >= 20 && frequency <=2000)
Over_Sam_Rate = 50;
elseif (frequency > 2000 && frequency <=20000)
Over_Sam_Rate = 10;
end

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by