当前位置:文档之家› matlab制作信号发生器

matlab制作信号发生器


Method
START
Initialize
INPUT: type amplitude frequency phase
Produce digital signal
Show the waveform
Method
• To build a GUI interface
Method
• Write M files
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);
Method
• Write M files
function sliderfuzhi_Callback(hObject, eventdata, handles) a=get(hObject,'value'); set(handles.editfuzhi,'string',a);
Results
• Sine waveform
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);
• Teamwork and Cooperation
Thank you!
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 .
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.ቤተ መጻሕፍቲ ባይዱ
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.
相关主题