matlab制作信号发生器

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
• Teamwork and Cooperation
Thank you!
signal generator
by 唐铭希 郭锴 程世奇 2013.9.22
Background
MATLAB(Matrix Laboratory)is a software from the mathworks,MATLAB has a powerful tool--gui (Graphical User Interface). In this project we use the gui to create a signal generator.
Hale Waihona Puke Baidu
Application
Signal generator also called signal source or oscillator,it can provide electrical signals of all kinds of frequency,waveform and phase, so it has been widely used In the field of production practice and science .
Method
• Write M files
function sliderfuzhi_Callback(hObject, eventdata, handles) a=get(hObject,'value'); set(handles.editfuzhi,'string',a);
Results
• Sine waveform
Method
START
Initialize
INPUT: type amplitude frequency phase
Produce digital signal
Show the waveform
Method
• To build a GUI interface
Method
• Write M files
Results
• white noise waveform
electric piano
• GUI interface
electric piano
• Write M files
function pushbutton1_Callback(hObject, eventdata, handles) a=2; f=131; fs=44100; x=30; t=linspace(0,1,fs); y=a*sin(2*pi*f*t+x); xianpin=findobj('tag','sinepinlv'); set(xianpin,'string',f); plot(t,y); grid; axis([0,0.05,-3,3]); wavplay(y,fs);
sin a=str2double(get(handles.editfuzhi,'String')); f=str2double(get(handles.editpinlv,'String')); x=str2double(get(handles.editxiangwei,'String')); c=str2double(get(handles.editcaiyang,'String')); t=0:8/(fs):8/f; y=a*sin(2*pi*(f*t+x/360)); plot(t,y);
Results
• from chengshiqi
Results
• from tangmingxi
Results
• from tangmingxi
Results
• from guokai
Results
• from guokai
What’s Left to Do
• The signal generator is simple,it can not convert the RMS,mean value and amplitude.
• The only have the seven basic scales,and it unable to import audio files .
What We Learn
• Use gui to build a interface ,and write m flies to Implement specific functions.
相关文档
最新文档