%///*****************************************************
%///Matlab 信号处理大实验一:数字电子琴的设计
%///作者:许均毅、李超、郭波江、熊勇
%///当前版本:1.0
%///完成时间:2010.04.01
%///*****************************************************
function varargout = ElecPiano(varargin)
% ELECPIANO M-file for ElecPiano.fig
% ELECPIANO, by itself, creates a new ELECPIANO or raises the existing
% singleton*.
%
% H = ELECPIANO returns the handle to a new ELECPIANO or the handle to
% the existing singleton*.
%
% ELECPIANO('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in ELECPIANO.M with the given input arguments.
%
% ELECPIANO('Property','Value',...) creates a new ELECPIANO or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before ElecPiano_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to ElecPiano_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
% Edit the above text to modify the response to help ElecPiano
% Last Modified by GUIDE v2.5 02-Apr-2010 05:50:49
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @ElecPiano_OpeningFcn, ...
'gui_OutputFcn', @ElecPiano_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 ElecPiano is made visible.
function ElecPiano_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 ElecPiano (see VARARGIN)
% Choose default command line output for ElecPiano
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes ElecPiano wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = ElecPiano_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;
global l4 l5 l6 l7 n1 n2 n3 n4 n5 n6 n7 h1 h2 h3 h4 mixsd wavfm1 wavfm2 wavfm3 wavfmp %设定各音阶频率值为全局变量
l4=175; l5=196; l6=220; l7=247; n1=262; n2=296; n3=330; n4=349; n5=392; n6=440; n7=494; h1=523; h2=587; h3=659; h4=698;
%设定各音阶频率变量值
mixsd=1; %设定初始值
wavfm1=1; %设定初始值
wavfm2=1; %设定初始值
wavfm3=1; %设定初始值
wavfmp=1; %设定初始值
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --------------------------------------------------------------------
function about_2_Callback(hObject, eventdata, handles)
% hObject handle to about_2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
msgbox('作者:许均毅,李超,郭波江,熊勇 ','版本1.0')
function edit2_Callback(hObject, eventdata, handles) %输入信号1幅值
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
global Amp1
Amp1=str2double(get(hObject,'string')); % 获取输入值
if isnan(Amp1) %输入非数值
errordlg('请输入一个数值','Bad Input','modal') %跳出一个对话框。
end
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit3_Callback(hObject, eventdata, handles) % 输入信号1频率
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
global freq1
freq1=str2double(get(hObject,'string')); % 获取输入值
if isnan(freq1) %输入非数值
errordlg('请输入一个数值','Bad Input','modal') %跳出一个对话框。
end
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit6_Callback(hObject, eventdata, handles) %输入信号1相位
% hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit6 as text
% str2double(get(hObject,'String')) returns contents of edit6 as a double
global pha1
pha1=str2double(get(hObject,'string')); % 获取输入值
if isnan(pha1) %输入非数值
errordlg('请输入一个数值','Bad Input','modal') %跳出一个对话框。
end
% --- Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
%
没有合适的资源?快使用搜索试试~ 我知道了~
使用matlab实现函数信号产生
共46个文件
m:30个
fig:11个
rar:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 7 下载量 11 浏览量
2022-04-02
11:29:30
上传
评论 2
收藏 146KB ZIP 举报
温馨提示
使用matlab实现函数信号产生,包括正弦波、锯齿波、方波、三角波、脉冲波、调制波等,可以设置波形幅值。 具体图像见:https://blog.csdn.net/m0_68894275/article/details/123916365
资源推荐
资源详情
资源评论
收起资源包目录
任意波形发生器.zip (46个子文件)
任意波形发生器
7674670dsp_system
zuoye5
main.m 13KB
filterfig.m 8KB
testGUI3.m 6KB
fft.m 3KB
amppha.fig 10KB
ampfre.m 3KB
ampfre.fig 10KB
main.fig 13KB
amppha.m 3KB
fftpin.fig 22KB
filterfig.fig 9KB
fftpin.m 4KB
fft.fig 7KB
qqqqqqqq
012006008511 刘志江 机制0611
sanjiao.m 117B
main.m 3KB
baizaosheng.m 114B
Untitled.m 106B
fangbo.m 99B
reply2.m 95B
reply.m 2KB
jieyue.m 112B
sin1.m 94B
reply1.m 100B
matlab.doc 43KB
91331948music2
music2.m 22KB
6054463elecpieno.rar 18KB
6054463elecpieno
新建文件夹
ElecPiano.m 41KB
ElecPiano.fig 13KB
91331948music2.rar 2KB
任意波形发生器
Copy_of_Untitledzhenxian.m 1KB
boxing.fig 9KB
Untitled.m 1KB
auntitled.m 7KB
unt2itled1.m 9KB
unt2itled1.fig 5KB
ud1.fig 7KB
Untitledzhenxian.m 1KB
ud1.m 14KB
wave_generator
tri_verify.m 2KB
sin.asv 1KB
sin_verify.m 5KB
squ_verify.m 2KB
a1111111111111.m 1KB
auntitled.fig 6KB
unt2itled1_activex1 4KB
boxing.m 26KB
共 46 条
- 1
人工智能专属驿站
- 粉丝: 274
- 资源: 174
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页