Create an LTI system from .wav file

10 次查看(过去 30 天)
I'm using Matlab for the first time and would like to know how to use the data from a .wav file to create an LTI system and play that as a sound. So far I have some basic functionality with the program, the DFT, magnitue and phase of the DFT if that makes any difference.
I've attempted something along these lines, but i'm certain it's not the right way to go about it
n = info.BitsPerSample;
y(n) = x(n) + 0.5*x(n-1) + 0.7*x(n-2);
sound(y(n), FS);
For the audio itself I have the following
[data,Fs] = audioread('sound.wav');
info = audioinfo('sound.wav');
sound(data, Fs);
  6 个评论
Star Strider
Star Strider 2022-4-29
@Bernardo Rodriguez Jr — That’s all there is to it. The LTI system estimate simply will do its best to model the transfer function as depicted in the Fourier transform of the sound.
I’m curious as to what your professor wanted to demonstrate with that assignment or lab exercise.
Mathieu NOE
Mathieu NOE 2022-4-29
well
that wav file is the output of a system , if we can call the system = the guitar ; and your fingers are your inputs
so yes maybe we could build a model of the guitar , but having only the output is not sufficient to know / modelize the guitar ; you can look at matlab function tfestimate to see how input and output data together can help you create a transfer function of a process , that can be transformed to a LTI model .
Also there are techniques to build models directly from time domain data (but always input and output data is needed)
% Reference:
% Subspace Identification for Linear Systems
% Theory - Implementation - Applications
% Peter Van Overschee / Bart De Moor
% Kluwer Academic Publishers, 1996
% Stochastic algorithm: Figure 3.13 page 90 (positive)
% Combined algorithm: Figure 4.8 page 131 (robust)

请先登录,再进行评论。

回答(1 个)

Chandra
Chandra 2022-5-6
Hi,
To pass a signal through a LTI system is done through convolution of transfer function and input signal
[data,Fs] = audioread('sound.wav');
%y(n) = x(n) + 0.5*x(n-1) + 0.7*x(n-2);
b = [1 0.5 0.7]; %numerator coefficients
a = 1; %denominator coefficients
y = filter(b,a,data);
sound(y, Fs);
%OR%
b = [1 0.5 0.7];
w(:,1) = conv(data(:,1),b);
w(:,2) = conv(data(:,2),b);
y = w;
sound(y, Fs);
In above both cases the y has same value, here the filter function process is same as convolution it can be done in either way
refer to filter and conv functions

类别

Help CenterFile Exchange 中查找有关 Audio Processing Algorithm Design 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by