Signal Processing Toolbox tutorial question

5 views (last 30 days)
I was trying to go through the Signal Processing Toolbox Getting Started Guide. My issues seem to start when I use 'design'. Any ideas ? I think I got the GUI tool stuff right.
Randy Seedle Email: rseedle@yahoo.com
This is my output:
>> t = (0:0.001:1)'; >> y = sin(2*pi*50*t) + 2*sin(2*pi*120*t); >> rng default; yn = y + 0.5*randn(size(t)); plot(t(1:50),yn(1:50)) >> t = (0:0.001:1)'; imp = [1; zeros(99,1)]; % Impulse unit_step = ones(100,1); % Step (with 0 initial cond.) ramp_sig = t; % Ramp quad_sig = t.^2; % Quadratic sq_wave = square(4*pi*t); >> z = [ramp_sig quad_sig sq_wave]; >> a = [1 zeros(1,5)]'; >> c = a(:,ones(1,3)); >> fs = 10000; t = 0:1/fs:1.5; x = sawtooth(2*pi*50*t); plot(t,x) axis([0 0.2 -1 1]) >> t = 0:1/1000:2; y = chirp(t,0,1,150); spectrogram(y,256,250,256,1000,'yaxis') >> T = 0:1/50E3:10E-3; D = [0:1/1E3:10E-3;0.8.^(0:10)]'; Y = pulstran(T,D,'gauspuls',10E3,0.5); plot(T,Y) >> x = linspace(-5,5); y = sinc(x); plot(x,y) >> x = linspace(0,4*pi,300); subplot(2,1,1) plot(x,diric(x,7)) axis tight title('n = 7') subplot(2,1,2) plot(x,diric(x,8)) axis tight title('n = 8') >> ver ---------------------------------------------------------------------------------------------------- MATLAB Version: 8.5.0.197613 (R2015a) MATLAB License Number: 0 Operating System: Microsoft Windows 7 Professional Version 6.1 (Build 7601: Service Pack 1) Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode ---------------------------------------------------------------------------------------------------- MATLAB Version 8.5 (R2015a) Simulink Version 8.5 (R2015a) Communications System Toolbox Version 6.0 (R2015a) Computer Vision System Toolbox Version 6.2 (R2015a) Control System Toolbox Version 9.9 (R2015a) Curve Fitting Toolbox Version 3.5.1 (R2015a) DSP System Toolbox Version 9.0 (R2015a) Data Acquisition Toolbox Version 3.7 (R2015a) Database Toolbox Version 5.2.1 (R2015a) Global Optimization Toolbox Version 3.3.1 (R2015a) Image Acquisition Toolbox Version 4.9 (R2015a) Image Processing Toolbox Version 9.2 (R2015a) Instrument Control Toolbox Version 3.7 (R2015a) Neural Network Toolbox Version 8.3 (R2015a) Optimization Toolbox Version 7.2 (R2015a) Parallel Computing Toolbox Version 6.6 (R2015a) Signal Processing Toolbox Version 7.0 (R2015a) Simulink Control Design Version 4.2 (R2015a) Stateflow Version 8.5 (R2015a) Statistics and Machine Learning Toolbox Version 10.0 (R2015a) Symbolic Math Toolbox Version 6.2 (R2015a) System Identification Toolbox Version 9.2 (R2015a) >> d = fdesign.bandpass
d =
Response: 'Bandpass'
Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
Description: {7x1 cell}
NormalizedFrequency: true
Fstop1: 0.35
Fpass1: 0.45
Fpass2: 0.55
Fstop2: 0.65
Astop1: 60
Apass: 1
Astop2: 60
>> set(BandPassSpecObj, 'Fpass2', 15800, 'Fstop2', 18400) Undefined function or variable 'BandPassSpecObj'.
>> set(bandpass, 'Fpass2', 15800, 'Fstop2', 18400) Undefined function or variable 'bandpass'.
>> set(fdesign, 'Fpass2', 15800, 'Fstop2', 18400) Error using fdesign (line 49) Use FDESIGN.* to create a digital filter designer. For example, h = fdesign.lowpass Type help fdesign/responses to get a list of valid responses.
>> set(d, 'Fpass2', 15800, 'Fstop2', 18400) >> d.Fpass2=15800; >> d
d =
Response: 'Bandpass'
Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
Description: {7x1 cell}
NormalizedFrequency: true
Fstop1: 0.35
Fpass1: 0.45
Fpass2: 15800
Fstop2: 18400
Astop1: 60
Apass: 1
Astop2: 60
>> d.A_stop1 = 60; No public field A_stop1 exists for class fdesign.bandpass.
>> d.Fstop1 = 60; >> d.F_stop1 = 8400; No public field F_stop1 exists for class fdesign.bandpass.
>> d.Fstop1 = 8400; >> d.Astop1 = 60; >> d.Fpass1 = 10800; >> d.Astop1 = 60; >> d.Astop2 = 60; >> d.Apass = 1; >> d
d =
Response: 'Bandpass'
Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
Description: {7x1 cell}
NormalizedFrequency: true
Fstop1: 8400
Fpass1: 10800
Fpass2: 15800
Fstop2: 18400
Astop1: 60
Apass: 1
Astop2: 60
>> d.Fpass2 = 15600; >> d
d =
Response: 'Bandpass'
Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
Description: {7x1 cell}
NormalizedFrequency: true
Fstop1: 8400
Fpass1: 10800
Fpass2: 15600
Fstop2: 18400
Astop1: 60
Apass: 1
Astop2: 60
>> d.Fstop2 = 18000; >> designmethods(d)
Design Methods for class fdesign.bandpass (Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2):
butter cheby1 cheby2 ellip equiripple kaiserwin
>> BandPassFilt = design(d, 'equiripple') Error using fdesign.abstracttype/equiripple (line 12) Frequency specifications must be between 0 and 1.
Error in fdesign.abstracttype/superdesign (line 125) Hd = feval(method, this, varargin{:},sysObjArgsDesign{:});
Error in fdesign.abstracttype/design (line 10) varargout{1} = superdesign(this, varargin{:});
>> d
d =
Response: 'Bandpass'
Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
Description: {7x1 cell}
NormalizedFrequency: true
Fstop1: 8400
Fpass1: 10800
Fpass2: 15600
Fstop2: 18000
Astop1: 60
Apass: 1
Astop2: 60
>> BandPassFiltSysObj = design(d,... 'equiripple','SystemObject',true) Error using fdesign.abstracttype/equiripple (line 12) Frequency specifications must be between 0 and 1.
Error in fdesign.abstracttype/superdesign (line 125) Hd = feval(method, this, varargin{:},sysObjArgsDesign{:});
Error in fdesign.abstracttype/design (line 10) varargout{1} = superdesign(this, varargin{:});
>> BandPassFilt = design(d) Error using fdesign.abstracttype/equiripple (line 12) Frequency specifications must be between 0 and 1.
Error in fdesign.abstracttype/superdesign (line 90) Hd = feval(d, this, varargin{:},sysObjArgsDesign{:});
Error in fdesign.abstracttype/design (line 10) varargout{1} = superdesign(this, varargin{:});
>> filterbuilder >> filterbuilder The variable 'Hbp' has been exported to the workspace. The variable 'Hbp' has been exported to the workspace. >> fvtool(Hbp) %plot the filter magnitude response >> fvtool(Hbp) %plot the filter magnitude response >>
  1 Comment
Christiaan
Christiaan on 4 Aug 2015
Dear Mr. Seedle,
Could you rewrite your question such that it is clear where the problem is?
Kind regards, Christiaan

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!