I am in engineering design in school. my design is to create a filter/amplification system for an acoustic guitar using code in MATLAB. I have two questions. First what should me code look like? Second what hardware can I use to impliment my code.

Here is a sample of my code, I have the same code with different cut off frequencies for all the notes that an aucoustic guitar can play:
This is one note in octave 4
Fs=1/4000;
t = 0:Fs:2;
C=sin(2*pi*261*t);
x_noise = C + randn(size(C));
[b,a] = butter(20,0.14,'low');
y = filter(b,a,x_noise);
[b,a] = butter(20, 0.13,'high');
c4=filter(b,a,y);
Can this code be exported to hardware? If not how can I fix it.

回答 (1 件)

Hari Desanur
Hari Desanur 2016 年 11 月 16 日
This example in the documentation shows how to design octave-band filters.
To be able to export MATLAB code to hardware, the functions in the MATLAB code must be supported for code generation. To determine if a function is suitable for code generation, use the coder.screener function.
You can also check all the functions suitable for code generation in this link.

1 件のコメント

Can you explain what Octave band filtering does? I'm having trouble understanding the documentation.

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

カテゴリ

ヘルプ センター および File ExchangeMeasurements and Spatial Audio についてさらに検索

質問済み:

2016 年 11 月 13 日

コメント済み:

2016 年 11 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by