calculate the Schroeder energy decay curve:

48 ビュー (過去 30 日間)
Hyungeun Yun
Hyungeun Yun 2021 年 2 月 9 日
回答済み: Nipun 2024 年 6 月 7 日
I am trying to understand these questions,
i have wav file and how could i make "for loop" and how could i make formula
1.Calculate the total energy present in the whole RIR as above. You will need to use a “for loop”.
2.Create an empty array of zero values that is the same length as the RIR file (in samples):
EDC = zeros(1,length(RIR));
3.Create a “for loop” to count from sample n = 1 (the start of the file) to sample n = N (the end of the file).
4.On each iteration of the for loop, calculate the energy level remaining in the RIR and save it to EDC sample ‘n’.
EDC(n) = sum(RIR(n:end).^2);

回答 (1 件)

Nipun
Nipun 2024 年 6 月 7 日
Hi Hyungeun,
I understand that you want to calculate the total energy in a WAV file using a "for loop" in MATLAB. Here is how you may do it, based on the shared information:
% Load the RIR file
[RIR, fs] = audioread('your_file.wav');
% Calculate the total energy in the RIR
totalEnergy = sum(RIR.^2);
% Create an empty array for EDC
EDC = zeros(1, length(RIR));
% Calculate the energy decay curve
for n = 1:length(RIR)
EDC(n) = sum(RIR(n:end).^2);
end
% Optionally, plot the EDC
plot(EDC);
title('Energy Decay Curve');
xlabel('Sample');
ylabel('Energy');
Hope this helps.
Regards,
Nipun

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by