📄 pronyanalysistool.m
字号:
axes(handles.axes_data_process);
plot(handles.window_x,handles.window_y,'b');
xlabel('Time'), ylabel('Signal'),...
title('Signal of defined Data Range');
end
if (get(handles.rdbutton_rangeoff,'Value') == get(handles.rdbutton_rangeoff,'Max'))
handles.window_x=deci_x;
handles.window_y=deci_y;
handles.flagwindow=0;
guidata(hObject, handles);
axes(handles.axes_data_process);
plot(handles.window_x,handles.window_y,'b');
xlabel('Time'), ylabel('Signal'),...
title('No Data Range is Applied');
end
setstatus(gcbf,'Apply the "Data Preprocessing" ');
% --- Executes on selection change in ppmnu_datapreprocess.
function ppmnu_datapreprocess_Callback(hObject, eventdata, handles)
% hObject handle to ppmnu_datapreprocess (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns ppmnu_datapreprocess contents as cell array
% contents{get(hObject,'Value')} returns selected item from ppmnu_datapreprocess
% --- Executes on button press in push_datapreprocess.
function push_datapreprocess_Callback(hObject, eventdata, handles)
% hObject handle to push_datapreprocess (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[x,y,x_val,y_val] = get_var_names(handles);
val = get(handles.ppmnu_datapreprocess,'Value');
switch val
case 1 % The user selected the remove mean
[dp_x,dp_y]=remove_mean(handles.window_x,handles.window_y,y);
preprocessid=1;
case 2 % The user selected the no change
dp_x=handles.window_x; dp_y=handles.window_y;
preprocessid=2;
case 3 % The user selected the Detrend
dp_x=handles.window_x;
dp_y=detrend(handles.window_y);
preprocessid=3;
end
handles.preprocessid=preprocessid;
%--Enable the Prony Analysis push button
set(handles.push_pronyanalysis,'Enable','on');
handles.dp_x=dp_x;
handles.dp_y=dp_y;
guidata(hObject,handles);
axes(handles.axes_data_process);
plot(dp_x,dp_y,'b');
xlabel('Time'), ylabel('Signal');
switch preprocessid
case 1
title('Signal after Removing Mean')
case 2
title('No Changes in the Decimated / Specific Range Signal')
case 3
title('Signal after Detrending')
case 4
title('Signal after Windowing')
end
setstatus(gcbf,'Press " Perform Prony Analysis"');
% --------------------------------------------------------------------
function menu_help_Callback(hObject, eventdata, handles)
% hObject handle to menu_help (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function menu_pronytool_Callback(hObject, eventdata, handles)
% hObject handle to menu_pronytool (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
HelpPath = which ('pronytoolhelp.html');
web(HelpPath,'-browser');
% --------------------------------------------------------------------
function menu_about_Callback(hObject, eventdata, handles)
% hObject handle to menu_about (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
HelpPath = which ('about.html');
web(HelpPath,'-browser');
% --------------------------------------------------------------------
function menu_demos_Callback(hObject, eventdata, handles)
% hObject handle to menu_demos (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
HelpPath = which ('demos.html');
web(HelpPath,'-browser');
% --------------------------------------------------------------------
function cmenu_data_Callback(hObject, eventdata, handles)
% hObject handle to cmenu_axes (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function plotnew_data_Callback(hObject, eventdata, handles)
% hObject handle to cmenu_plotnew (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function cmenu_data_process_Callback(hObject, eventdata, handles)
% hObject handle to cmenu_data_process (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function plotnew_data_process_Callback(hObject, eventdata, handles)
% hObject handle to plotnew_data_process (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function plotnew_deci_Callback(hObject, eventdata, handles)
% hObject handle to plotnew_deci (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Plot the Decimated Signal
PronyData=export_data(handles);
figure('Color','White');
plot(PronyData.deci_x,PronyData.deci_y);
xlabel('Time'), ylabel('Decimated Signal'),...
if(handles.flagdecimate==1)
title(sprintf('Signal after Down Sampling of %d ',PronyData.dfactor));
else
title('No Decimation is Applied');
end
% --------------------------------------------------------------------
function plotnew_preprocess_Callback(hObject, eventdata, handles)
% hObject handle to plotnew_preprocess (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Plot the Preprocessed Signal
PronyData=export_data(handles);
figure('Color','White');
plot(PronyData.dp_x,PronyData.dp_y);
xlabel('Time'), ylabel('Preprocessed Signal'),...
title('Signal after Data Preprocessing ');
% --- Executes on selection change in lstbx_depvar.
function lstbx_depvar_Callback(hObject, eventdata, handles)
% hObject handle to lstbx_depvar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns lstbx_depvar contents as cell array
% contents{get(hObject,'Value')} returns selected item from lstbx_depvar
% --- Executes during object creation, after setting all properties.
function lstbx_depvar_CreateFcn(hObject, eventdata, handles)
% hObject handle to lstbx_depvar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes during object creation, after setting all properties.
function lstbx_indepvar_CreateFcn(hObject, eventdata, handles)
% hObject handle to lstbx_indepvar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on selection change in lstbx_indepvar.
function lstbx_indepvar_Callback(hObject, eventdata, handles)
% hObject handle to lstbx_indepvar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns lstbx_indepvar contents as cell array
% contents{get(hObject,'Value')} returns selected item from lstbx_indepvar
% --- Executes during object creation, after setting all properties.
function ppmnu_datapreprocess_CreateFcn(hObject, eventdata, handles)
% hObject handle to ppmnu_datapreprocess (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes during object creation, after setting all properties.
function axes_data_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes_data (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes_data
% --------------------------------------------------------------------
function menu_gridoff_Callback(hObject, eventdata, handles)
% hObject handle to menu_gridoff (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
axes(handles.axes_data_process);
grid off;
axes(handles.axes_data);
grid off;
% --------------------------------------------------------------------
function menu_gridon_Callback(hObject, eventdata, handles)
% hObject handle to menu_gridoff (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
axes(handles.axes_data_process);
grid on;
axes(handles.axes_data);
grid on;
% --------------------------------------------------------------------
function menu_file_Callback(hObject, eventdata, handles)
% hObject handle to menu_file (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function menu_view_Callback(hObject, eventdata, handles)
% hObject handle to menu_view (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function menu_close_Callback(hObject, eventdata, handles)
% hObject handle to menu_close (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close(gcf);
% --- Executes during object creation, after setting all properties.
function Status_CreateFcn(hObject, eventdata, handles)
% hObject handle to Status (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% --------------------------------------------------------------------
function plotnew_orig_Callback(hObject, eventdata, handles)
% hObject handle to plotnew_orig (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
PronyData=export_data(handles);
figure('Color','White');
plot(PronyData.x_val,PronyData.y_val);
xlabel('Time'), ylabel('Original Signal'),...
title('Original Signal Plot ');
% --------------------------------------------------------------------
function plotnew_window_Callback(hObject, eventdata, handles)
% hObject handle to plotnew_orig (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
PronyData=export_data(handles);
figure('Color','White');
plot(PronyData.window_x,PronyData.window_y);
xlabel('Time'), ylabel('Signal');
if(handles.flagwindow==1)
title('Specific Data Range Signal Plot ');
else
title('No Data Range is Applied');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -