编程介的小学生 2017-09-27 10:09 采纳率: 20.5%
浏览 811
已采纳

New Signal Decomposition

Problem Description
We consider a sequence A with p float-point numbers denoted by a0,a1,...,ap−1 where p is a prime number. To simplify our problem, we guarantee that p must be 13, 103 or 100003.
To make a decomposition for this sequence, we define the kernal functions
r(h,k)=2sin3(2πhkp)

Therefore we can get a new sequence B = {b0,b1,...,bp−1} tranformed from the original sequence A where
bk=∑h=0p−1ah∗r(h,k)

Your mission is to calculate the new sequence B.

Input
The first line is the number of test cases. Each test case contains two lines. The first line contains an integer p. The second line contains p float-point numbers corresponding to the sequence A.

Output
For each test case, output p float-point numbers rounded to three decimal places in one line corresponding to the sequence B.

Sample Input
13
7 0 0 0 0 0 0 0 0 0 0 0 0
13
1 2 3 4 5 6 7 8 9 10 11 12 13
13
11 7 7 7 7 7 7 7 7 7 7 7 7

Sample Output
7.000 7.000 7.000 7.000 7.000 7.000 7.000
7.000 7.000 7.000 7.000 7.000 7.000
91.000 85.477 92.015 93.543 91.049 99.763
98.551 98.517 97.304 106.018 103.525
105.053 111.590
95.000 102.032 102.032 102.032 102.032
102.032 102.032 102.032 102.032 102.032
102.032 102.032 102.032

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-10-15 01:56
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥100 已有python代码,要求做成可执行程序,程序设计内容不多
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答
  • ¥20 在本地部署CHATRWKV时遇到了AttributeError: 'str' object has no attribute 'requires_grad'