Set nondefault values for feature extractor object
Set Parameter Values for Feature Extraction
signalFrequencyFeatureExtractor object to extract the Welch power spectral density (PSD) estimate of a signal consisting of a 100 Hz sinusoid in additive N(0,1) white noise. The sample rate is 1 kHz and the signal has a duration of 5 seconds.
fs = 1000; t = 0:1/fs:5-1/fs; x = cos(2*pi*100*t) + randn(size(t)); sFE = signalFrequencyFeatureExtractor(SampleRate=fs,WelchPSD=true);
For the PSD computation, set the
25 samples and the
512 samples. Call the
getExtractorParameters function on the object to view the PSD parameters.
setExtractorParameters(sFE,"WelchPSD",OverlapLength=25,FFTLength=1024) params = getExtractorParameters(sFE,"WelchPSD")
params = struct with fields: FFTLength: 1024 FrequencyVector:  OverlapLength: 25 Window: 
extract function to extract the Welch's PSD estimate of the signal. Plot the result.
feature = extract(sFE,x); fvec = linspace(0,fs/2,length(feature)); plot(fvec,pow2db(abs(feature))) xlabel("Frequency (Hz)") ylabel("PSD (dB/Hz)") grid
sFE — Feature extractor object
Feature extractor object, specified as a
featurename — Extracted feature
string scalar | character vector
Extracted feature, specified as a string scalar or a character vector.
Introduced in R2021b