Guest User

Untitled

a guest
Jul 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.72 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main() {
  4. double array[] = {-5.537953712545116e-7,-0.0000031696252607369252,1.9631563532787612e-7,0.000005277892907150729,9.250091561854548e-7,-0.000007804743294275352,-0.0000031370887339576953,0.000010533302921396444,0.000006768948681551834,-0.000013105419320707577,-0.000012110042928545098,0.00001500961830854481,0.00001935897270813319,-0.000015582347467442616,-0.000028565298311577773,0.000014026170964550263,0.00003956849390680001,-0.000009447808474392477,-0.0000519393685552439,9.176964443935002e-7,0.00006493032315361938,0.000012448879943751631,-0.00007744149326537993,-0.000031391011086568924,0.00008801001415022948,0.000056385880256180084,-0.0000948292290897826,-0.00008752340401956533,0.00009580357141007432,0.0001243804213579043,-0.00008864306107327401,-0.0001659049522193386,0.00007099889373122516,0.0002103224316367466,-0.00004063855355831581,-0.000255076505263314,-0.000004344598273768925,0.0002968167698188594,0.00006529601755525738,-0.0003314446396255786,-0.00014275139117429913,0.00035422624718089047,0.00023619057614594714,-0.00035997795601965584,-0.0003438126152341621,0.00034332576960429604,0.00046235221028920724,-0.0002990348374487613,-0.0005869586852277708,0.000222399659275732,0.0007111577161494125,-0.00010967978232058593,-0.0008269138287306367,-0.0000414398062413715,0.0009248078046140204,0.00023138937799055983,-0.0009943377777927014,-0.000458285978947421,0.0010243461188531291,0.0007175679868680891,-0.0010035664992817303,-0.0010017256486965545,0.0009212772038604437,0.0013001592128391126,-0.0007680383082338183,-0.0015991927622674743,0.0005364823075236054,0.00188226618785092,-0.00022212077403045458,-0.0021303199981733992,-0.0001758758434346253,0.0023223782349322493,0.000653971485124757,-0.0024363240125457237,-0.0012036778300364417,0.002449850760982658,0.0018111326852899155,-0.0023415607844612654,-0.002456883282796081,0.0020921720177675376,0.003115906228480309,-0.0016857846565672828,-0.0037578848585772474,0.0011111524429244406,0.004347751221561283,-0.0003628995453946476,-0.0048464842731494855,-0.0005573761388564959,0.00521213866723879,0.0016401682087784,-0.005401060254942328,-0.002867341335381741,0.005369225429272437,0.004211656373833475,-0.005073621789701795,-0.005636551187935444,0.004473566590054946,0.007096158520933182,-0.003531835180936884,-0.008535502713701723,0.0022154399646757885,0.009890761442306285,-0.0004958528651350378,-0.011089395244635621,-0.0016516163057698695,0.01204981377956065,0.00424972140382454,-0.012680013658798986,-0.007323187747193262,0.012874179424600852,0.01090595253890436,-0.01250533032306027,-0.015054378745121825,0.011410074222411892,0.019872174996922734,-0.009356609907066581,-0.025560717764858475,0.0059737694486738475,0.03253156628706298,-0.0005772676783110545,-0.04169653256287484,-0.008327589784380073,0.05538644867881382,0.02487211920201651,-0.08141250589904382,-0.0664188690941706,0.16959970142599157,0.42842646521722005,0.42842646521722005,0.16959970142599157,-0.0664188690941706,-0.08141250589904382,0.02487211920201651,0.05538644867881382,-0.008327589784380073,-0.04169653256287484,-0.0005772676783110545,0.03253156628706298,0.0059737694486738475,-0.025560717764858475,-0.009356609907066581,0.019872174996922734,0.011410074222411892,-0.015054378745121825,-0.01250533032306027,0.01090595253890436,0.012874179424600852,-0.007323187747193262,-0.012680013658798986,0.00424972140382454,0.01204981377956065,-0.0016516163057698695,-0.011089395244635621,-0.0004958528651350378,0.009890761442306285,0.0022154399646757885,-0.008535502713701723,-0.003531835180936884,0.007096158520933182,0.004473566590054946,-0.005636551187935444,-0.005073621789701795,0.004211656373833475,0.005369225429272437,-0.002867341335381741,-0.005401060254942328,0.0016401682087784,0.00521213866723879,-0.0005573761388564959,-0.0048464842731494855,-0.0003628995453946476,0.004347751221561283,0.0011111524429244406,-0.0037578848585772474,-0.0016857846565672828,0.003115906228480309,0.0020921720177675376,-0.002456883282796081,-0.0023415607844612654,0.0018111326852899155,0.002449850760982658,-0.0012036778300364417,-0.0024363240125457237,0.000653971485124757,0.0023223782349322493,-0.0001758758434346253,-0.0021303199981733992,-0.00022212077403045458,0.00188226618785092,0.0005364823075236054,-0.0015991927622674743,-0.0007680383082338183,0.0013001592128391126,0.0009212772038604437,-0.0010017256486965545,-0.0010035664992817303,0.0007175679868680891,0.0010243461188531291,-0.000458285978947421,-0.0009943377777927014,0.00023138937799055983,0.0009248078046140204,-0.0000414398062413715,-0.0008269138287306367,-0.00010967978232058593,0.0007111577161494125,0.000222399659275732,-0.0005869586852277708,-0.0002990348374487613,0.00046235221028920724,0.00034332576960429604,-0.0003438126152341621,-0.00035997795601965584,0.00023619057614594714,0.00035422624718089047,-0.00014275139117429913,-0.0003314446396255786,0.00006529601755525738,0.0002968167698188594,-0.000004344598273768925,-0.000255076505263314,-0.00004063855355831581,0.0002103224316367466,0.00007099889373122516,-0.0001659049522193386,-0.00008864306107327401,0.0001243804213579043,0.00009580357141007432,-0.00008752340401956533,-0.0000948292290897826,0.000056385880256180084,0.00008801001415022948,-0.000031391011086568924,-0.00007744149326537993,0.000012448879943751631,0.00006493032315361938,9.176964443935002e-7,-0.0000519393685552439,-0.000009447808474392477,0.00003956849390680001,0.000014026170964550263,-0.000028565298311577773,-0.000015582347467442616,0.00001935897270813319,0.00001500961830854481,-0.000012110042928545098,-0.000013105419320707577,0.000006768948681551834,0.000010533302921396444,-0.0000031370887339576953,-0.000007804743294275352,9.250091561854548e-7,0.000005277892907150729,1.9631563532787612e-7,-0.0000031696252607369252,-5.537953712545116e-7};
  5.  
  6. double sum;
  7. int interpolationFactor = 4;
  8.  
  9. printf("Size of array = %drn", sizeof(array)/sizeof(*array));
  10.  
  11. for(int polyphase = 0; polyphase < interpolationFactor; polyphase++) {
  12. sum = 0.0;
  13.  
  14. for(int i = polyphase; i < sizeof(array)/sizeof(*array); i += interpolationFactor)
  15. sum += array[i] * interpolationFactor;
  16.  
  17. printf("Sum of array for polyphase %d = %lfrn", polyphase, sum);
  18. }
  19. }
  20.  
  21. Size of array = 256
  22. Sum of array for polyphase 0 = 1.000000
  23. Sum of array for polyphase 1 = 1.000000
  24.  
  25. Size of array = 256
  26. Sum of array for polyphase 0 = 0.999996
  27. Sum of array for polyphase 1 = 1.000004
  28. Sum of array for polyphase 2 = 1.000004
  29. Sum of array for polyphase 3 = 0.999996
  30.  
  31. Size of array = 256
  32. Sum of array for polyphase 0 = 2.847754
  33. Sum of array for polyphase 1 = 1.765369
  34. Sum of array for polyphase 2 = 0.234639
  35. Sum of array for polyphase 3 = -0.847761
  36. Sum of array for polyphase 4 = -0.847761
  37. Sum of array for polyphase 5 = 0.234639
  38. Sum of array for polyphase 6 = 1.765369
  39. Sum of array for polyphase 7 = 2.847754
Add Comment
Please, Sign In to add comment