Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================
- // Name : sinussignal.cpp
- // Author : pnguyen_
- // Version :
- // Copyright : Your copyright notice
- // Description : Hello World in C++, Ansi-style
- //============================================================================
- #include <iostream>
- #include <math.h>
- using namespace std;
- const double PI = 3.141592;
- void tues (double *&array, double T, double f, double fs)
- {
- double x;
- //Abtastpunkte = Arraygröße
- int n=T*fs;
- array= new double [n];
- //Bogenmaß; w=2*pi*f
- for(int i=0;i<n;i++)
- {
- array [i] = sin (i*(2*PI*(f/fs)));
- cout << i << ' ' << array[i]<< endl;
- }
- }
- int main()
- {
- double *a = NULL;
- tues(a,0.001,1000,50000);
- delete[] a;
- a=NULL;
- return 0;
- }
Add Comment
Please, Sign In to add comment