error using bandpass and pspectrum function

3 Ansichten (letzte 30 Tage)
Sameen Mustafa
Sameen Mustafa am 13 Apr. 2019
Beantwortet: Star Strider am 13 Apr. 2019
I am trying to band filter a response saved as .txt file and display the power spectrum
it returns the error : Undefined function 'bandpass' for input arguments of type 'double'.
it returns the same error for pspectrum.
kindly help.
load pop.txt; % brings in ASCII text file containing pressure values
bandpass(pop, [880 1130], fs); % trying to filter the signal for centre frequency 1kHz and fs sampling rate
pspectrum(pop,fs);

Akzeptierte Antwort

Star Strider
Star Strider am 13 Apr. 2019
The pspectrum function was released in R2017b. Depending on what you want to do, use the spectrogram (link) function or the the pwelch (link) functo to get the power spectral density. If you want to look at your signals before and after filtering, see: Power Spectral Density Estimates Using FFT (link).
Since you do not have the bandpass function, the next best option is to use an elliptic filter. See the documentation on ellip (link) and related functions (linked to in that page) to understand how to design it. The design is straightforward, and elliptical filters are probably the most computationally efficient of any design.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by