[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Butter Command - Maximum Order and Cut Off Frequency - Issues
From: |
Shadders |
Subject: |
Re: Butter Command - Maximum Order and Cut Off Frequency - Issues |
Date: |
Thu, 18 Jan 2018 16:56:32 -0700 (MST) |
Hi,
No error messages, but the plots have bad values.
The following works :
[b,a] = butter(12, 0.95) - plots are ok (multiple sine waves, different
frequencies, distinct)
The following plots a single exponentially increasing sine wave which
increases to values from 3e305 to -3e305, and terminates plotting at approx
1/8 of the expected values for the x axis :
[b,a] = butter(12, 0.98)
The output of the filter has from the 1/8 distance, NaN in the remainder of
the vector.
Code that replicates failure - simple
=================================
nc = 5; % Number of cycles of the waveform
fs = 192000;
ts = 1/fs;
n = 0:192000; % Variable used for indexing
x = zeros(1, length(n)); % Input signal initialisation
[b,a] = butter(12, 0.98); % Create the butterworth response
k1 = fs/1000;
k1n=0:(nc*k1);
x1k = sin(2*pi*k1n/k1);
x(1, 1000:1000+length(x1k)-1) = x1k;
y = filter(b, a, x); % Use the filter function
figure(1);
plot(n, y)
=================================
Regards,
Shadders.
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html