MATLAB Answers

Error in filtering data

14 views (last 30 days)
Trishneeta Bhattacharya
Trishneeta Bhattacharya on 26 Mar 2020 at 13:15
I am trying to filter sla data which has 2191 data points (daily data from 2013 to 2018). The code I am using is given below. While I run this code, I am getting an error.
In filtfilt>getCoeffsAndInitialConditions (line 200)
In filtfilt (line 97)
In filter_matlab (line 8)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.419047e-16.
What is the meaning of it?
My code is:
sla = ncread('', 'SLA_AVE');
highcut = (2191/100)/(2191/2); %define highcut frequency 100 days in radians
lowcut =(2191/250)/(2191/2); %define lowcut frequency 250 days in radians
[b,a] = butter(6,[lowcut highcut]); %create 6th order butterworth band pass filter
freqz(b,a); %look at your filter characteristics
FilteredData = filtfilt(b,a,sla); %filter Data without phase shift
t=datenum(datestr(ncread('', 'TIME')+datenum(1950,1,1)));
plot(t, sla, 'linewidth', 1.5);
hold on;
plot(t, FilteredData, 'linewidth', 1.5);
axis tight;
set(gca,'XTick', xtck);
Also, What is the meaning of defining 100 days in radians. Why is it necessary?


Sign in to comment.

Answers (0)

Sign in to answer this question.