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.nc', '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
plot(t, sla, 'linewidth', 1.5);
plot(t, FilteredData, 'linewidth', 1.5);
Also, What is the meaning of defining 100 days in radians. Why is it necessary?