function varargout = fft_m(varargin)
% FFT_M M-file for fft_m.fig
% FFT_M, by itself, creates a new FFT_M or raises the existing
% singleton*.
%
% H = FFT_M returns the handle to a new FFT_M or the handle to
% the existing singleton*.
%
% FFT_M('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in FFT_M.M with the given input arguments.
%
% FFT_M('Property','Value',...) creates a new FFT_M or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before fft_m_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to fft_m_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
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help fft_m
% Last Modified by GUIDE v2.5 10-Sep-2009 10:37:00
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @fft_m_OpeningFcn, ...
'gui_OutputFcn', @fft_m_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before fft_m is made visible.
function fft_m_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to fft_m (see VARARGIN)
% Choose default command line output for fft_m
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes fft_m wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = fft_m_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton_draw.
function pushbutton_draw_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_draw (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
ScopeData=evalin('base','ScopeData');
axes(handles.axes1);
fft_out=fft(ScopeData(:,2));
fs=1/(ScopeData(2,1)-ScopeData(1,1));
plot((0:length(ScopeData(:,2))/2-1)*fs/length(ScopeData(:,2)),10*log(abs(fft_out(1:length(ScopeData(:,2))/2))/abs(max(fft_out))));
xlabel('频率(Hz)');
ylabel('幅度')
axis([0 fs/2 -50 0])
% --- Executes on button press in pushbutton_save.
function pushbutton_save_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_save (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close

cooper325
- 粉丝: 5
最新资源
- CSerialPort-Rust资源
- vben-app-移动应用开发资源
- skywu520codelib-单片机开发资源
- vue3-element-admin-Typescript资源
- dubbo-go-Go资源
- java毕业设计,物流信息管理系统
- OpenAuth.Net-C#资源
- goploy-PHP资源
- excelize-wasm-JavaScript资源
- Archery-SQL资源
- 教师教学质量评价系统的设计与实现-毕业设计资源
- online-judge-ACM资源
- olympic_predict-美赛资源
- dachuang-大创资源
- vcos_apps-智能车资源
- CSDN_ASSEMBLY_IMAGES-汇编语言资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



- 1
- 2
前往页