lab8.c - #include#include#include#include#include ...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <stdio.h> #include <math.h> #include <ctype.h> #include <stdlib.h> #include "fftw3.h" #define SAMPLERATE 48000 #define DURATION 5 #define AMPLITUDE 1 #define MAXline 240000 double Music[MAXline][2]; double in_1[MAXline][2]; double out_1[MAXline][2]; void Dataread(double Sample_Amplitude, double Music[][2], FILE*input); void FFT(double in_1[][2], double out_1[][2]); void largest(double arr[][2], int arr_size, int first, int second, int third); int main(int argc,char *argv[]) { double Sample_Amplitude; FILE *input; input = fopen((argv[argc - 3]), "r"); Dataread(Sample_Amplitude, Music, input); fclose(input); } void Dataread(double Sample_Amplitude, double in_1[][2], FILE*input) { int i; char trash[100]; fgets(trash, 100, input); fgets(trash, 100, input); fgets(trash, 100, input); fgets(trash, 100, input); for (i = 0; (!feof(input)); i++) { fscanf(input, " %lf %lf", &in_1[i][0], &in_1[i][1]);//in[i][0]= Time, in[i][1] =S A } } void FFT(double in_1[][2],double out_1[][2]) { int i; int first_domainant, second_domainant, third_domainant;
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern