fs=8000;
dt=1/fs;
T=0.5;
t=0:dt:T-dt;
xt=cos(100*pi*t)-2*cos(50*pi*t);
rt=xt+cos(120*pi*t);
pa = bandstop(rt,[230 450],fs);
plot(t,pa);

11 comentarios

Dipjyoti Das
Dipjyoti Das el 30 de Nov. de 2018
Editada: Dipjyoti Das el 30 de Nov. de 2018
Undefined function 'bandstop' for input arguments of type 'double'
its showing plz help
KSSV
KSSV el 30 de Nov. de 2018
Where is the function bandstop ?
Dipjyoti Das
Dipjyoti Das el 30 de Nov. de 2018
is it not a predefined function in matlab?
Preethi
Preethi el 30 de Nov. de 2018
do you have signal processing toolbox installed?
Dipjyoti Das
Dipjyoti Das el 30 de Nov. de 2018
yes..but in another question in matlab I saw he said it doesn't work in 2017 versions only work in 2018 version
Stephan
Stephan el 30 de Nov. de 2018
Bandstop was introduced in R2018a
Dipjyoti Das
Dipjyoti Das el 30 de Nov. de 2018
is there any way I can use it in 2017a?
Preethi
Preethi el 30 de Nov. de 2018
try this function
d = designfilt();
Adam
Adam el 30 de Nov. de 2018
You should get used to always using the help that comes with your Matlab rather than the online help (or at least once you have used the online help first then refer to your local help) as the online help is always for the latest version of Matlab so if you are running an older one then you may well end up trying to use functions that don't exist in your version.
Dipjyoti Das
Dipjyoti Das el 30 de Nov. de 2018
plz specify how to write the function designfilt instead of bandstop
Jan
Jan el 30 de Nov. de 2018
Editada: Jan el 30 de Nov. de 2018
The original question was solved: The problem of using the function bandstop, which does not exist in your Matlab version. Now you ak a new question: How to use designfilt to emulate the call of the modern bandstop . Please ask one question per thread only.

Iniciar sesión para comentar.

 Respuesta aceptada

Jan
Jan el 30 de Nov. de 2018
For your second question: "write the function designfilt instead of bandstop":
B = designfilt('bandstopfir', 'SampleRate', 8000, ...
'PassbandFrequency1', 230, 'PassbandFrequency2', 450, ...
'StopBandFrequency1', 247.27, 'StopBandFrequency2', 432.73, ...
'StopbandAttenuation', 60, ...
'PassbandRipple1', 0.1, 'PassbandRipple2', 0.1, ...
'DesignMethod', 'kaiserwin');

3 comentarios

madhan ravi
madhan ravi el 30 de Nov. de 2018
+1 Jan your knowledge is vast!
Jan
Jan el 30 de Nov. de 2018
Editada: Jan el 30 de Nov. de 2018
@madvan: I do not have knowledge about filter design. I just opened the online help of bandpass and displayed the filter object also by catching the 2nd output.
[pa, F] = bandstop(rt,[230 450],fs);
disp(F)
Then I read the help of designfilt and found out, how to create the same object F.
Alternatively you could read the source code: type bandpass . To my surprise this works in the online help also.
So my knowledge is limited to not hesitating to use the available documentation exhaustively. ;-)
madhan ravi
madhan ravi el 30 de Nov. de 2018
;)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Signal Processing Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 30 de Nov. de 2018

Comentada:

el 30 de Nov. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by