C语言实现FFT算法 - 开发手记

C语言实现FFT算法 - 开发手记 C语言实现FFT算法 - 开发手记 Realize FFT transformation by C language. by Shun Fu, DSP Lab of Northeastern University. In order to do frequency analyze for an input signal, we need to do the DFT transform for the data sampled from our codec(AD/DA). Read more about DFT: http://en.wikipedia.org/wiki/Discrete_Fourier_transform FFT is a more efficiency algorithm for calculating the DFT. Here I don’t describe what is FFT algorithm, you can check it on wikipedia.com Here is a figure explaining the principle of 3 order (N = 2^3 = 8points) FFT algorithm.

READ MORE

linux下kbhit()函数 getch函数。

linux下kbhit()函数 getch函数。 怎样在C语言执行循环程序时按键盘任意键停止程序,再按再继续执行? 参考http://zhidao.baidu.com/question/272086855.html 在linux下C语言写了一个while循环,怎么实现按任意键退出。如何编写程序? 参考:http://zhidao.baidu.com/question/461121586.html 对于上面的问题,都用到 linux下的getch函数与kbhit函数。 参考了http://kpld8888.wordpress.com/2007/03/07/linux%E4%B8%8B%E7%9A%84getch%E5%87%BD%E6%95%B0%E4%B8%8Ekbhit%E5%87%BD%E6%95%B0-2/ 和:http://zhidao.baidu.com/question/461121586.html 但是我照搬上面两条都不能很好的编译,总是有错误。奉上我的文件: 将下列三个文件放在工程目录下,build project即可。 main.c: 1. #include "kbhit.h" 2. #include <stdio.h> 3. #include <stdlib.h> 4. #include "accelerometer.h" //contains the middle level macros, state variable 5. // definition and declaration for the 6. //middle layer (class layer) functions 7. 8. 9. 10. void delay(int a){ 11. int i,j,delay; 12. for(i = 0 ; i < 1170*(200/a); i++){ 13. delay = 0; 14. for(j = 0; j < 100; j++){ 15. delay = delay+1; 16.

READ MORE

MATLAB 3D 动画制作(一、二、三)

MATLAB 3D 动画制作(一)- 3D 图形设计 MATLAB 3D Animation – 3D object design Auther: Sonictl Northeastern University. 前言:本系列教程将逐步完成一个有趣的MATLAB 3D动画,MATLAB 3D图形的绘制和3D动画的制作可以让工程人员很直观地展示工作内容,特别是在虚拟现实,控制系统设计,人机交互,计算机视觉,等领域都能得到应用。 Introduction: This series of tutorials are going to discuss a process of making 3D animation using MATLAB step by step. The 3D animation in MATLAB can let the engineers exhibit their work. It can be used widely, especially at the fields of Virtual Reality, Control system Designing, Human-machine interactivity, Computer Vision, etc. 首先介绍一下本教程的最终效果: Below is the final effect of this 3D animation.

READ MORE

MATLAB 3D 动画制作(三)- 实时随动3D动画设计

MATLAB 3D 动画制作(三)- 实时随动3D动画设计 MATLAB 3D 动画制作(三)- 实时随动3D动画设计 MATLAB 3D Animation – Real-time 3D Animation Design Author: Sonictl Northeastern University. 前言:本教程将逐步完成一个有趣的MATLAB 3D实时随动动画, 本篇将使用串口数据实时控制动画中的物体的运动。“MATLAB 3D 动画制作(三)- 实时随动3D动画设计” 是 “MATLAB 3D 动画制作(二)- 3D 动画动作设计” 的进阶篇。 本篇将使用串口数据实时控制动画中的物体的运动。 Introduction: This series of tutorials are going to discuss a process of making 3D animation using MATLAB step by step. The 3D animation in MATLAB can let the engineers exhibit their work. It can be used widely, especially at the fields of Virtual Reality, Control system Designing, Human-machine interactivity, Computer Vision, etc.

READ MORE

MATLAB 3D 动画制作(二)- 3D 动画动作设计

MATLAB 3D 动画制作(二)- 3D 动画动作设计 MATLAB 3D 动画制作(二)- 3D 动画动作设计 MATLAB 3D Animation – 3D Animation Action Design Auther: Sonictl Northeastern University. 前言:本系列教程将逐步完成一个有趣的MATLAB 3D动画,MATLAB 3D图形的绘制和3D动画的制作可以让工程人员很直观地展示工作内容,特别是在虚拟现实,控制系统设计,人机交互,计算机视觉,等领域都能得到应用。 MATLAB 3D 动画制作(二)- 3D 动画动作设计 是 MATLAB 3D 动画制作(一)- 3D 图形设计 的进阶篇。 Introduction: This series of tutorials are going to discuss a process of making 3D animation using MATLAB step by step. The 3D animation in MATLAB can let the engineers exhibit their work. It can be used widely, especially at the fields of Virtual Reality, Control system Designing, Human-machine interactivity, Computer Vision, etc.

READ MORE

MATLAB 3D 动画制作(一)- 3D 图形设计

MATLAB 3D 动画制作(一)- 3D 图形设计 MATLAB 3D 动画制作(一)- 3D 图形设计 MATLAB 3D Animation – 3D object design Auther: Sonictl Northeastern University. 前言:本系列教程将逐步完成一个有趣的MATLAB 3D动画,MATLAB 3D图形的绘制和3D动画的制作可以让工程人员很直观地展示工作内容,特别是在虚拟现实,控制系统设计,人机交互,计算机视觉,等领域都能得到应用。 Introduction: This series of tutorials are going to discuss a process of making 3D animation using MATLAB step by step. The 3D animation in MATLAB can let the engineers exhibit their work. It can be used widely, especially at the fields of Virtual Reality, Control system Designing, Human-machine interactivity, Computer Vision, etc. 首先介绍一下本教程的最终效果: Below is the final effect of this 3D animation.

READ MORE

MATLAB 3D 动画简单实例

MATLAB 3D 动画简单实例 MATLAB 3D 动画简单实例 翻译自网站: http://www.matrixlab-examples.com/simple-animation-3d.html 本文是在系统学习MATLAB绘图(2D-3D)之前的一个引例。 系统学习资料在: MATLAB 2-D and 3-D 绘图 望喜欢! 本文将展示2个使用MATLAB制作的简单的3D动画。在第一个例子中,我们对一个球体sphere进行动画制作,旋转了观察的角度,但没有改变物体形状。 在第二个例子中,我们画了一个抛物面paraboloid,并且改变了它的大小和形状。这些简单的技术是MATLAB动画制作的基础。 1. 球体的动画 首先我们绘制了一个球体,并且保证3D坐标系的比例是正常的。然后,变换我们观察的角度,从方位角和高度进行了改变。整个过程不改变球体形状大小,只是改变视角。 ‘drawnow’语句作用就是更新当前的图形。它冲掉了queue事件,强行让MATLAB更新屏幕。 完成以上功能的代码如下: clear; clc; close all % Draw a sphere sphere % Make the current axis box square in size axis('square') % Define title and labels for reference title('Rotation of a sphere...') xlabel('x'); ylabel('y'); zlabel('z') % Modify azimuth (horizontal rotation) and update drawing for az = -50 : .2 : 30 view(az, 40) drawnow end % Modify elevation (vertical rotation) and update drawing for el = 40 : -.

READ MORE

MATLAB 3D 动画简单实例

MATLAB 3D 动画简单实例 MATLAB 3D 动画简单实例 翻译自网站: http://www.matrixlab-examples.com/simple-animation-3d.html 本文是在系统学习MATLAB绘图(2D-3D)之前的一个引例。 系统学习资料在: MATLAB 2-D and 3-D 绘图 望喜欢! -—————– 本文将展示2个使用MATLAB制作的简单的3D动画。在第一个例子中,我们对一个球体sphere进行动画制作,旋转了观察的角度,但没有改变物体形状。 在第二个例子中,我们画了一个抛物面paraboloid,并且改变了它的大小和形状。这些简单的技术是MATLAB动画制作的基础。 球体的动画 首先我们绘制了一个球体,并且保证3D坐标系的比例是正常的。然后,变换我们观察的角度,从方位角和高度进行了改变。整个过程不改变球体形状大小,只是改变视角。 ‘drawnow’语句作用就是更新当前的图形。它冲掉了queue事件,强行让MATLAB更新屏幕。 完成以上功能的代码如下: -————————– clear; clc; close all % Draw a sphere sphere % Make the current axis box square in size axis('square') % Define title and labels for reference title('Rotation of a sphere...') xlabel('x'); ylabel('y'); zlabel('z') % Modify azimuth (horizontal rotation) and update drawing for az = -50 : .2 : 30 view(az, 40) drawnow end % Modify elevation (vertical rotation) and update drawing for el = 40 : -.

READ MORE

三轴力传感器数据在MATLAB中实时显示

三轴力传感器数据在MATLAB中实时显示 演示视频: http://v.youku.com/v_show/id_XNTAwODg3Njc2.html 使用了嵌入式PAL Board作为数据采集装置,搭载ADI公司的ADXL345三轴力传感器。使用串口RS232传输数据到MATLAB,MATLAB建立串口对象,每上来一组数据就调用一次回调函数。回调函数实现绘图的功能。Enjoy! 本例程是修改自:MATLAB动画显示串口数据【实例】 Display the real-time data acquired form 3-axis accelerometer sensor in MATLAB Demo video: http://www.youtube.com/watch?v=YoBn7LAtDrU Used the embedded PAL board to capture the accelerometer data. The board contains the 3-axis accelerometer sensor ADXL345 produced by Analog Devices. Sent the data to MATLAB through serial port. Built the serial object in MATLAB. Call the callback function when the data generated. The callback function realize the plotting function. Enjoy! Explorer More: MATLAB 3D 动画制作(一)- 3D 图形设计

READ MORE

三轴力传感器数据在MATLAB中实时显示

2013-01-12_三轴力传感器数据在MATLAB中实时显示 演示视频: http://v.youku.com/v_show/id_XNTAwODg3Njc2.html 使用了嵌入式PAL Board作为数据采集装置,搭载ADI公司的ADXL345三轴力传感器。使用串口RS232传输数据到MATLAB,MATLAB建立串口对象,每上来一组数据就调用一次回调函数。回调函数实现绘图的功能。Enjoy! 本例程是修改自:MATLAB动画显示串口数据【实例】 Display the real-time data acquired form 3-axis accelerometer sensor in MATLAB Demo video: http://www.youtube.com/watch?v=YoBn7LAtDrU Used the embedded PAL board to capture the accelerometer data. The board contains the 3-axis accelerometer sensor ADXL345 produced by Analog Devices. Sent the data to MATLAB through serial port. Built the serial object in MATLAB. Call the callback function when the data generated. The callback function realize the plotting function. Enjoy! Explorer More: MATLAB 3D 动画制作(一)- 3D 图形设计

READ MORE