⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eqfilters.html

📁 均衡器的参数设置,设置不同的参数
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<span class="comment">% hObject    handle to edit2 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    structure with handles and user data (see GUIDATA)</span><span class="comment">% Hints: get(hObject,'String') returns contents of edit2 as text</span><span class="comment">%        str2double(get(hObject,'String')) returns contents of edit2 as a</span><span class="comment">%        double</span><span class="keyword">function</span> edit1_Callback(hObject, eventdata, handles)    <span class="keyword">global</span> lowest_freq;    lowest_freq = str2double(get(hObject,<span class="string">'string'</span>));    <span class="keyword">if</span> isnan(lowest_freq)        errordlg(<span class="string">'You must enter a numeric value'</span>,<span class="string">'Bad Input'</span>,<span class="string">'modal'</span>)    <span class="keyword">end</span><span class="keyword">function</span> edit1_CreateFcn(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit1 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    empty - handles not created until after all CreateFcns called</span><span class="comment">% Hint: edit controls usually have a white background on Windows.</span><span class="comment">%       See ISPC and COMPUTER.</span><span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))    set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);<span class="keyword">end</span></pre><h2>High frequency input<a name="15"></a></h2><pre class="codeinput"><span class="comment">%**************************************************************************</span><span class="comment">%High Freq Input Callback function:</span><span class="comment">%**************************************************************************</span><span class="keyword">function</span> edit2_Callback(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit2 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    structure with handles and user data (see GUIDATA)</span><span class="comment">% Hints: get(hObject,'String') returns contents of edit2 as text</span><span class="comment">%        str2double(get(hObject,'String')) returns contents of edit2 as a double</span>    <span class="keyword">global</span> highest_freq;    highest_freq = str2double(get(hObject,<span class="string">'string'</span>));    <span class="keyword">if</span> isnan(highest_freq)        errordlg(<span class="string">'You must enter a numeric value'</span>,<span class="string">'Bad Input'</span>,<span class="string">'modal'</span>)    <span class="keyword">end</span><span class="comment">% --- Executes during object creation, after setting all properties.</span><span class="keyword">function</span> edit2_CreateFcn(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit2 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    empty - handles not created until after all CreateFcns called</span><span class="comment">% Hint: edit controls usually have a white background on Windows.</span><span class="comment">%       See ISPC and COMPUTER.</span><span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))    set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);<span class="keyword">end</span></pre><h2>Number of filters input<a name="16"></a></h2><pre class="codeinput"><span class="comment">%**************************************************************************</span><span class="comment">%Number of Filters Input Callback function:</span><span class="comment">%**************************************************************************</span><span class="keyword">function</span> edit3_Callback(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit3 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    structure with handles and user data (see GUIDATA)</span><span class="comment">% Hints: get(hObject,'String') returns contents of edit3 as text</span><span class="comment">%        str2double(get(hObject,'String')) returns contents of edit3 as a double</span>    <span class="keyword">global</span> n_filters;    n_filters = str2double(get(hObject,<span class="string">'string'</span>));    <span class="keyword">if</span> isnan(n_filters)        errordlg(<span class="string">'You must enter a numeric value'</span>,<span class="string">'Bad Input'</span>,<span class="string">'modal'</span>)    <span class="keyword">end</span><span class="comment">% --- Executes during object creation, after setting all properties.</span><span class="keyword">function</span> edit3_CreateFcn(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit3 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    empty - handles not created until after all CreateFcns called</span><span class="comment">% Hint: edit controls usually have a white background on Windows.</span><span class="comment">%       See ISPC and COMPUTER.</span><span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))    set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);<span class="keyword">end</span></pre><h2>Quality input<a name="17"></a></h2>         <p>For this input, the program does diffeent things based on whether the user inputs a scalar or vector.  If the user inputs            a vector, the code conceptualizes it as such.         </p><pre class="codeinput"><span class="comment">%**************************************************************************</span><span class="comment">%Quality Input Callback function:</span><span class="comment">%**************************************************************************</span><span class="keyword">function</span> edit4_Callback(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit4 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    structure with handles and user data (see GUIDATA)</span><span class="comment">% Hints: get(hObject,'String') returns contents of edit4 as text</span><span class="comment">%        str2double(get(hObject,'String')) returns contents of edit4 as a double</span>    <span class="keyword">global</span> n;    <span class="keyword">global</span> q0;    quality_input = get(hObject,<span class="string">'string'</span>);    quality_input2 = regexp(quality_input, <span class="string">' '</span>, <span class="string">'split'</span>);    <span class="keyword">if</span> (length(quality_input2) == 0)        q0 = str2num(quality_input)    <span class="keyword">else</span>        q0 = cellfun(@str2num,quality_input2)    <span class="keyword">end</span><span class="keyword">function</span> edit4_CreateFcn(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit4 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    empty - handles not created until after all CreateFcns called</span><span class="comment">% Hint: edit controls usually have a white background on Windows.</span><span class="comment">%       See ISPC and COMPUTER.</span><span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))    set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);<span class="keyword">end</span></pre><h2>Passband gain input<a name="19"></a></h2>         <p>Again, the user can enter a scalar or a vector here.</p><pre class="codeinput"><span class="comment">%**************************************************************************</span><span class="comment">%Passband Gain Callback function:</span><span class="comment">%**************************************************************************</span><span class="keyword">function</span> edit5_Callback(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit5 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    structure with handles and user data (see GUIDATA)</span><span class="comment">% Hints: get(hObject,'String') returns contents of edit5 as text</span><span class="comment">%        str2double(get(hObject,'String')) returns contents of edit5 as a double</span>    <span class="comment">%global n;</span>    <span class="keyword">global</span> hbp;    passband_gain_input = get(hObject,<span class="string">'string'</span>);    passband_gain_input2 = regexp(passband_gain_input, <span class="string">' '</span>, <span class="string">'split'</span>);    hbp = cellfun(@str2num,passband_gain_input2)    <span class="keyword">if</span> (length(passband_gain_input2) == 0)        hbp = str2num(passband_gain_input)    <span class="keyword">else</span>        hbp = cellfun(@str2num,passband_gain_input2)    <span class="keyword">end</span><span class="keyword">function</span> edit5_CreateFcn(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit5 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    empty - handles not created until after all CreateFcns called</span><span class="comment">% Hint: edit controls usually have a white background on Windows.</span><span class="comment">%       See ISPC and COMPUTER.</span><span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))    set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);<span class="keyword">end</span></pre><h2>Minimum resistor value<a name="21"></a></h2>         <p>The minimum resistor value is stored to the first index in the options vector.</p><pre class="codeinput"><span class="keyword">function</span> edit9_Callback(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit9 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    structure with handles and user data (see GUIDATA)</span><span class="comment">% Hints: get(hObject,'String') returns contents of edit9 as text</span><span class="comment">%        str2double(get(hObject,'String')) returns contents of edit9 as a double</span><span class="keyword">global</span> options;options(1) = str2double(get(hObject,<span class="string">'string'</span>))<span class="comment">% --- Executes during object creation, after setting all properties.</span><span class="keyword">function</span> edit9_CreateFcn(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit9 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    empty - handles not created until after all CreateFcns called</span><span class="comment">% Hint: edit controls usually have a white background on Windows.</span><span class="comment">%       See ISPC and COMPUTER.</span><span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))    set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);<span class="keyword">end</span></pre><h2>Maximum capacitor value<a name="23"></a></h2>         <p>options(4) holds the maximum capacitor value</p><pre class="codeinput"><span class="keyword">function</span> edit12_Callback(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit9 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    structure with handles and user data (see GUIDATA)</span><span class="comment">% Hints: get(hObject,'String') returns contents of edit9 as text</span><span class="comment">%        str2double(get(hObject,'String')) returns contents of edit9 as a double</span><span class="keyword">global</span> options;options(4) = str2double(get(hObject,<span class="string">'string'</span>))<span class="comment">% --- Executes during object creation, after setting all properties.</span><span class="keyword">function</span> edit12_CreateFcn(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit9 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    empty - handles not created until after all CreateFcns called</span><span class="comment">% Hint: edit controls usually have a white background on Windows.</span><span class="comment">%       See ISPC and COMPUTER.</span><span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))    set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);<span class="keyword">end</span></pre><h2>Minimum capacitor value<a name="25"></a></h2>         <p>options(3) holds the minimum capacitor value</p><pre class="codeinput"><span class="keyword">function</span> edit11_Callback(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit9 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    structure with handles and user data (see GUIDATA)</span><span class="comment">% Hints: get(hObject,'String') returns contents of edit9 as text</span><span class="comment">%        str2double(get(hObject,'String')) returns contents of edit9 as a double</span><span class="keyword">global</span> options;options(3) = str2double(get(hObject,<span class="string">'string'</span>))<span class="comment">% --- Executes during object creation, after setting all properties.</span><span class="keyword">function</span> edit11_CreateFcn(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit9 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    empty - handles not created until after all CreateFcns called</span><span class="comment">% Hint: edit controls usually have a white background on Windows.</span><span class="comment">%       See ISPC and COMPUTER.</span><span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))    set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);<span class="keyword">end</span></pre><h2>Maximum capacitor value<a name="26"></a></h2>         <p>options(2) holds the maximum capacitor value.</p><pre class="codeinput"><span class="keyword">function</span> edit10_Callback(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit9 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    structure with handles and user data (see GUIDATA)</span><span class="comment">% Hints: get(hObject,'String') returns contents of edit9 as text</span><span class="comment">%        str2double(get(hObject,'String')) returns contents of edit9 as a double</span><span class="keyword">global</span> options;options(2) = str2double(get(hObject,<span class="string">'string'</span>))<span class="comment">% --- Executes during object creation, after setting all properties.</span><span class="keyword">function</span> edit10_CreateFcn(hObject, eventdata, handles)<span class="comment">% hObject    handle to edit9 (see GCBO)</span><span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span><span class="comment">% handles    empty - handles not created until after all CreateFcns called</span><span class="comment">% Hint: edit controls usually have a white background on Windows.</span><span class="comment">%       See ISPC and COMPUTER.</span><span class="keyword">if</span> ispc &amp;&amp; isequal(get(hObject,<span class="string">'BackgroundColor'</span>), get(0,<span class="string">'defaultUicontrolBackgroundColor'</span>))    set(hObject,<span class="string">'BackgroundColor'</span>,<span class="string">'white'</span>);<span class="keyword">end</span></pre><p class="footer"><br>            Published with MATLAB&reg; 7.4<br></p>      </div>      <!--##### SOURCE BEGIN #####%% Main GUI file
%%
% Most of this was created by GUIDE, so comments will be sparse.

function varargout = EQFilters(varargin)
%%
% EQFILTERS M-file for EQFilters.fig
%      EQFILTERS, by itself, creates a new EQFILTERS or raises the existing
%      singleton*.
%
%      H = EQFILTERS returns the handle to a new EQFILTERS or the handle to
%      the existing singleton*.
%
%      EQFILTERS('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in EQFILTERS.M with the given input arguments.
%
%      EQFILTERS('Property','Value',...) creates a new EQFILTERS or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before EQFilters_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to EQFilters_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -