combine result of fdatool with GUI - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


combine result of fdatool with GUI

polo_coinspolo_coins Posts: 2Member
here I build some function inside one of callbacks, inside of it I enter filter design ,result of fdatool and combine it with GUI otions ,but it doesn't work

function Hd = LP1

Am=str2num( get(handles.edit5,'String') );
Fm=str2num( get(handles.edit4,'String') );
Phase=str2num( get(handles.edit6,'String') );
time=str2num( get(handles.edit3,'String') );
Ac=str2num( get(handles.edit2,'String') );
Fc=str2num( get(handles.edit1,'String') );

% create some white noise
St_N=St+r; % add noise to signal

%LP1 Returns a discrete-time filter object.

% M-File generated by MATLAB(R) 7.6 and the Signal Processing Toolbox 6.9.
% Generated on: 25-Mar-2011 10:30:25

% Butterworth Lowpass filter designed using FDESIGN.LOWPASS.

% All frequency values are in Hz.

Fpass =str2num( get(handles.edit5,'String') ); % Passband Frequency
Fstop = str2num( get(handles.edit5,'String') )+200; % Stopband Frequency
Fs=Fstop*2.5; % Sampling Frequency

Apass = 1; % Passband Ripple (dB)
Astop = 1.5; % Stopband Attenuation (dB)
match = 'stopband'; % Band to match exactly

% Construct an FDESIGN object and call its BUTTER method.
h = fdesign.lowpass(Fpass, Fstop, Apass, Astop, Fs);
Hd = design(h, 'butter', 'MatchExactly', match);

plot(t, Clean_St_N)
Sign In or Register to comment.