| back | サーバ選択 (基本[ 1 , 2 , IP ], ミラー[ 1 , 2 , IP ] |
DSP 初心者のための入門のページ |
void main()
{
int x,y,z;
z=0;
x=z+1;
y=2*(z+x);
z=x+y;
}
MEMORY
{
RAM: origin = 0x0, length = 0x10000
}
#define BSize 96
void main()
{
float s1buff[BSize];
float c1buff[BSize];
float s2buff[BSize];
float c2buff[BSize];
float yybuff[BSize];
int i;
float a,b;
float c,d;
a=0.99786;
b=0.06540;
c=0.94693;
d=0.32144;
s1buff[0]=0.0;
c1buff[0]=1.0;
s2buff[0]=0.0;
c2buff[0]=1.0;
yybuff[0]=s1buff[0]*s2buff[0];
for (i=1; i<BSize; i++) {
s1buff[i]=a*s1buff[i-1]+b*c1buff[i-1];
c1buff[i]=a*c1buff[i-1]-b*s1buff[i-1];
s2buff[i]=c*s2buff[i-1]+d*c2buff[i-1];
c2buff[i]=c*c2buff[i-1]-d*s2buff[i-1];
yybuff[i]=s1buff[i]*s2buff[i];
}
}
MEMORY
{
RAM: origin = 0x0, length = 0x10000
}
| 1 行目 | Display Type | グラフの型を指定します。 これ以外に,FFT なども選べます |
| 2 行目 | Start Address | ここの文字列は, グラフのタイトルとして使われます |
| 3 行目 | Start Address | 配列名を指定します |
| 4 行目 | Acquisition ... | 読み込むデータの数 |
| 6 行目 | Display Data Size | 表示するデータの数 |
| 7 行目 | DSP Data Type | 今回の C 言語の例題では float 型の配列なので 32-bit IEEE floating point を指定しました。 別の型の配列を作ったなら, ここで対応する型を指定します |
| 3 行目 | Start Address | s2buff |
| 3 行目 | Start Address | ybuff |
| 1 行目 | Display Type | FFT Magnitude |
#include <math.h>
#define BSize 96
void main()
{
float s1buff[BSize];
float s2buff[BSize];
float yybuff[BSize];
int i;
float rad;
rad=0;
for (i=0; i<BSize; i++) {
s1buff[i]=sin(rad);
s2buff[i]=sin(5.*rad);
yybuff[i]=s1buff[i]*s2buff[i];
rad+=2.*3.14159/96.;
}
}
MEMORY
{
RAM: origin = 0x0, length = 0x10000
}
#include <stdio.h>
void main()
{
printf("Hello World ! \n");
}
MEMORY
{
RAM: origin = 0x0, length = 0x10000
}