フィルターのクリア

Designfilt and crossover filters?

2 ビュー (過去 30 日間)
Darsana P M
Darsana P M 2017 年 3 月 16 日
コメント済み: Star Strider 2017 年 3 月 24 日
Can anybody help me with an alternative function for DesignFilt and crossover filters. These functions work only with matlab 2016. it doesn't work in matlab 2013. What is the alternative function?

採用された回答

Star Strider
Star Strider 2017 年 3 月 16 日
In R2013a, see the documentation on fdatool (link) and the other functions such as fdesign (link) that appear in the same documentation page.
  8 件のコメント
Darsana P M
Darsana P M 2017 年 3 月 17 日
編集済み: Star Strider 2017 年 3 月 17 日
Can you please explain it once again. Is this the code that i must use?? But i got an error in the for loop part??
Fs = 8200; % Samping Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
pf = linspace(20,4000,17); % Passband Frequencies
cf = pf(1:end-1)+(pf(2)-pf(1))/2; % Centre Frequencies
for k1 = 1:length(cf)
[z(k1,:),p(k1,:),k(k1)] = butter(7, [pf(k1) pf(k1+1)]/Fn);
[sos{k1},g{k1}] = zp2sos(z(k1,:),p(k1,:),k(k1));
[h(k1,:),w(k1,:)] = freqz(sos{k1},512,Fs);
end
figure(1)
plot(w([1 16],:), abs(h([1 16],:)))
grid
% axis([0 0.2 ylim])
figure(2)
freqz(sos{1})
hold on
for k1 = 2:16
freqz(sos{k1})
end
hold off
Star Strider
Star Strider 2017 年 3 月 17 日
You will need to change the code to design the filters that meet your requirements. Use your own sampling frequency, and define your filter passband frequencies in a vector and assign them to the ‘pf’ variable. You might be able to use the linspace call with only minor modifications. The rest of my code should work without any need to change it.
I ran that code just now and it ran for me without error (in R2017a, the code was written in R2015a). What error did you see? Please copy the entire red text of the error from the Command Window and paste it to a comment here.

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

その他の回答 (2 件)

Darsana P M
Darsana P M 2017 年 3 月 17 日
Error using vertcat Dimensions of matrices being concatenated are not consistent.
Error in zp2sos>orderp (line 247) new_p = [p_conj;p_real];
Error in zp2sos (line 94) [new_p,p_conj,p_real] = orderp(p_conj,p_real);
Error in band8 (line 7) [sos{k1},g{k1}] = zp2sos(z(k1,:),p(k1,:),k(k1));
This is the error that i obtained. I tried it in matlab 2013a
  10 件のコメント
Darsana P M
Darsana P M 2017 年 3 月 19 日
Ok...Thanks a lot
Star Strider
Star Strider 2017 年 3 月 19 日
My pleasure.

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


Darsana P M
Darsana P M 2017 年 3 月 22 日
Fs = 8200; % Samping Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
pf = [20 100:100:2E+4] % Passband Frequencies
cf = pf(1:end-1)+(pf(2)-pf(1))/2; % Centre Frequencies
for k1 = 1:length(cf)
[z(k1,:),p(k1,:),k(k1)] = butter(7, [pf(k1) pf(k1+1)]/Fn);
[sos{k1},g{k1}] = zp2sos(z(k1,:),p(k1,:),k(k1));
[h(k1,:),w(k1,:)] = freqz(sos{k1},512,Fs);
end
figure(1)
plot(w([1 16],:), abs(h([1 16],:)))
grid
% axis([0 0.2 ylim])
figure(2)
freqz(sos{1})
hold on
for k1 = 2:16
freqz(sos{k1})
end
hold off
I wrote the pf command as you said. pf=[20 100:100:2E+4]. But i got an error saying
the cut off frequencies must be within the interval (0,1); line 57
[z(k1,:),p(k1,:),k(k1)] = butter(7, [pf(k1) pf(k1+1)]/Fn); line 7
This was done to get a similar graph as shown in figure?? What will i do?
  4 件のコメント
Darsana P M
Darsana P M 2017 年 3 月 24 日
Thanks a lot
Star Strider
Star Strider 2017 年 3 月 24 日
My pleasure.

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

カテゴリ

Help Center および File ExchangeDigital Filter Design についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by