资源简介
设计一个简易的数字信号发生器,将信号输出到输出区域,并实现以下功能(输出):
1)输出信号类型有:方波、三角波、正弦波。
2)可以通过按键进行倍频、降频等操作。
3)实现“功放”(即输出信号幅度放大N倍)
附:从用户使用习惯的角度考虑界面设计的合理性、易用性等,自己设定输入信息的方式。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
comboBox1.Items.Add(“方波“);
comboBox1.Items.Add(“三角波“);
comboBox1.Items.Add(“正弦波“);
}
public bool checkVpp(string Vpp)
{
float result ;
if (Vpp == String.Empty)
{
MessageBox.Show(“Vpp不能为空“);
return false;
}
else if(!float.TryParse(Vpp out result))
{
MessageBox.Show(“Vpp仅能为纯数字“);
return false;
}
else return true;
} //针对Vpp的检查
public bool checkfre(string Fre)
{
float result;
if (Fre == String.Empty)
{
MessageBox.Show(“Frequency不能为空“);
return false;
}
else if (!float.TryParse(Fre out result))
{
MessageBox.Show(“Frequency仅能为纯数字“);
return false;
}
else return true;
} //针对Frequency的检查
public void fangbo(float V float fre)
{
double t = 0;
for (t = 0; t <= 2 * Math.PI; t += 0.01)
{
int n = (int)(2 * t * fre);
if(n % 2==0) //判断是否处于低电平
chart1.Series[“Channel 1“].Points.AddXY(t 0);
else
chart1.Series[“Channel 1“].Points.AddXY(t V);
}
} //方波函数
public void sanjiao(float V float fre)
{
double k = 2 * V * fre; //k是斜率
double t = 0;
for (t = 0; t <= 2 * Math.PI; t += 0.01)
{
int n = (int)(2 * t * fre);
if (n % 2 == 0) //判断是否处于上升沿
chart1.Series[“Channel 1“].Points.AddXY(t -0.5 * V + k * ( 2 * t * fre - n ) / ( 2 * fre ) );
else
chart1.Series[“Channel 1“].Points.AddXY(t 0.5 * V - k * (2 * t * fre - n) / ( 2 * fre ));
}
} //三角波函数
public void zhengxian(float Vfloat fre)
{
double t = 0;
for (t = 0; t <= 2 * Math.PI; t += 0.02) //默认显示0到2PI范围内的波形
{
double ch1 = V * Math.Sin(2 * Math.PI * fre * t);
chart1.Series[“Channel 1“].Points.AddXY(t ch1);
}
} //正弦波函数
public void fangbo_Autoset(float V float fre)
{
double t = 0;
for (t = 0; t <= 3 / fre; t +=
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 914 2019-03-08 19:42 WindowsFormsApplication4.sln
文件 26112 2019-03-22 15:52 WindowsFormsApplication4.suo
目录 0 2019-03-08 19:42 WindowsFormsApplication4\
目录 0 2019-03-08 19:42 WindowsFormsApplication4\bin\
目录 0 2019-03-08 20:17 WindowsFormsApplication4\bin\Debug\
文件 32768 2019-03-14 17:31 WindowsFormsApplication4\bin\Debug\WindowsFormsApplication4.exe
文件 32256 2019-03-14 17:31 WindowsFormsApplication4\bin\Debug\WindowsFormsApplication4.pdb
文件 11600 2019-03-22 15:51 WindowsFormsApplication4\bin\Debug\WindowsFormsApplication4.vshost.exe
文件 490 2018-04-12 07:35 WindowsFormsApplication4\bin\Debug\WindowsFormsApplication4.vshost.exe.manifest
文件 10147 2019-03-14 17:31 WindowsFormsApplication4\Form1.cs
文件 12879 2019-03-14 17:31 WindowsFormsApplication4\Form1.Designer.cs
文件 29599 2019-03-14 17:27 WindowsFormsApplication4\Form1.resx
目录 0 2019-03-08 19:42 WindowsFormsApplication4\obj\
目录 0 2019-03-08 19:42 WindowsFormsApplication4\obj\x86\
目录 0 2019-03-14 17:31 WindowsFormsApplication4\obj\x86\Debug\
文件 6272 2019-03-09 20:33 WindowsFormsApplication4\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6893 2019-03-14 17:31 WindowsFormsApplication4\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
目录 0 2019-03-08 19:42 WindowsFormsApplication4\obj\x86\Debug\TempPE\
文件 1266 2019-03-22 15:51 WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.csproj.FileListAbsolute.txt
文件 975 2019-03-14 17:27 WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.csproj.GenerateResource.Cache
文件 10016 2019-03-09 23:11 WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.csprojResolveAssemblyReference.cache
文件 32768 2019-03-14 17:31 WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.exe
文件 16311 2019-03-14 17:27 WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.Form1.resources
文件 32256 2019-03-14 17:31 WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.pdb
文件 180 2019-03-11 22:26 WindowsFormsApplication4\obj\x86\Debug\WindowsFormsApplication4.Properties.Resources.resources
文件 505 2019-03-08 19:42 WindowsFormsApplication4\Program.cs
目录 0 2019-03-08 19:42 WindowsFormsApplication4\Properties\
文件 1380 2019-03-08 19:42 WindowsFormsApplication4\Properties\AssemblyInfo.cs
文件 2900 2019-03-08 19:42 WindowsFormsApplication4\Properties\Resources.Designer.cs
文件 5612 2019-03-08 19:42 WindowsFormsApplication4\Properties\Resources.resx
文件 1111 2019-03-08 19:42 WindowsFormsApplication4\Properties\Settings.Designer.cs
............此处省略2个文件信息
- 上一篇:北邮 专业实验 设计电路并输出到模拟示波器上
- 下一篇:D2d通信模拟代码
相关资源
- WPF USB 网络 串口 通信软件
- B/S 网上订餐系统
- 教室管理系统.rar
- 小鸡快跑游戏.
-
分别适用于.NET fr
amework 2.0和4.0的E - 汽车租赁系统............................
- 德卡D8读写器关于读写感应卡的一些代
- halcon 测量助手
- 图片存储到数据库保存二进制文件并
- 用Socket写的简易FTP服务器和客户端
- 企业销售管理信息系统(全套)
- 串口操作类(justinio)
- 基于Petri网的工作流(完整的原创源代
- 选择题自动考试系统
- 多线程实例:桌面智能弹球小游戏
- 土地信息管理系统
- ServiceStack V3.9 全部dll
- PDF pdfview.ocx 无水印
- 无需共享打印机实现远程打印功能小
- 真正的破解版PDFView4NET
- 网页调用ActiveX控件获取串口数据
- Luence的与盘古分词的使用软件
- Emgu.CV 打开视频与人脸检测
- 麦克纳姆轮程序.rar
- Unity3D 实战视频教程 保卫萝卜 2D 游戏
- net微信支付
- lucene.net+盘古分词多条件全文检索并匹
- 闪电猫-电商下图助手5.0.zip
- FastReport.Net V2014.4.8 For .Net2.0
- NET Reflector 8.3破解版自带代码导出
评论
共有 条评论