필터 지우기
필터 지우기

How to get equation of signal in matlab

조회 수: 21 (최근 30일)
Muhammad Usman Saleem
Muhammad Usman Saleem 2017년 7월 15일
댓글: Star Strider 2017년 7월 24일
I want to find equation of this signal.
I plot this time series data and filter it with sSgolay filter. Now I want to get equation of this signal. Is this possible in matlab??
I have attached data of this plot with this post
  댓글 수: 4
Muhammad Usman Saleem
Muhammad Usman Saleem 2017년 7월 20일
@Grej Thanks for your reply. I have not expertise in neural network. So I not know whether this network has created for such meteorological problems. In matlab I know there are some models like AR, ARMA which simulate the data set then forecast it. I tried them alot but unable to fit them due to lacking in expertise.
How can I forecast snow for one day ahead using this time series data set?
Thanks
Greg Heath
Greg Heath 2017년 7월 20일
help NARNET
doc NARNET
help NNCORR
doc NNCORR
greg NARNET
Hope this helps.
Greg

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2017년 7월 15일
I am not certain what you intend by getting an equation for it.
You can filter out the noise to see the general trend:
fidi = fopen('data.txt','rt');
D = textscan(fidi, '%s%f', 'Delimiter','\t', 'CollectOutput',1);
t = datenum(D{1});
s = D{2};
Ts = mean(diff(t)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
L = numel(t); % Signal Length
sm = s-mean(s); % Subtract Mean To Make Amplitudes At Frequencies>0 More Prominent
FTs = fft(sm)/L; % Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
Phs = angle(FTs);
figure(1)
plot(Fv, abs(FTs(Iv))*2)
grid
xlabel('Frequency (Days^{-1})')
ylabel('Amplitude')
set(gca, 'XLim',[0 0.05])
Wp = [0.0045]/Fn; % Passband Frequencies (Normalised)
Ws = [0.0055]/Fn; % Stopband Frequencies (Normalised)
Rp = 10; % Passband Ripple (dB)
Rs = 50; % Stopband Ripple (dB)
[n,Ws] = cheb2ord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k] = cheby2(n,Rs,Ws); % Filter Design
[sosbp,gbp] = zp2sos(z,p,k); % Convert To Second-Order-Section For Stability
figure(2)
freqz(sosbp, 2^16, Fs) % Filter Bode Plot
s_filt = filtfilt(sosbp,gbp, s); % Filter Signal
figure(3)
plot(t, s, '-b')
hold on
plot(t, s_filt, '-r', 'LineWidth',1.5)
hold off
xlabel('Time (Days)')
ylabel('Amplitude')
legend('Original', 'Lowpass Filtered')
  댓글 수: 8
Muhammad Usman Saleem
Muhammad Usman Saleem 2017년 7월 24일
Thank you sir so much!
Star Strider
Star Strider 2017년 7월 24일
As always, my pleasure!
If my Answer helped solve your problem, please Accept it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by