Documentation |
Estimate frequency response with fixed frequency resolution using spectral analysis
G = spa(data)
G = spa(data,winSize,freq)
G = spa(data,winSize,freq,MaxSize)
G = spa(data) estimates frequency response (with uncertainty) and noise spectrum from time- or frequency-domain data. data is an iddata or idfrd object and can be complex valued. G is as an idfrd object. For time-series data, G is the estimated spectrum and standard deviation.
G = spa(data,winSize,freq) estimates frequency response at frequencies freq. freq is a row vector of values in rad/sec. winSize is a scalar integer that sets the size of the Hann window.
G = spa(data,winSize,freq,MaxSize) can improve computational performance using MaxSize to split the input-output data such that each segment contains fewer than MaxSize elements. MaxSize is a positive integer.
Estimate frequency response with fixed resolution at 128 equally spaced, logarithmic frequency values between 0 (excluded) and π:
load iddata3; z = z3; % z is an iddata object with Ts=1 g = spa(z); bode(g)
Estimate frequency response with fixed resolution at logarithmically spaced frequencies:
% Define frequency vector w = logspace(-2,pi,128); % Compute frequency response g= spa(z,[],w); % [] specifies the default lag window size h = bodeplot(g); showConfidence(h,3) figure h = spectrumplot(g); showConfidence(h,3) % The plots include confidence interval % of 3 standard deviations