No.1905 PURE PHRASE
タグ : / 解いたユーザー数 85
作問者 : 👑
hitonanode
/ テスター :
Sumitacchan
Problem Statement
You are given a sound waveform $\mathbf{A} = [A_1, \dots, A_{N}]$ of length $N = 44100$ (that is, $1$ second long) recorded at a sampling rate of $44100~\mathrm{Hz}$. That is, $A_i$ $(1 \le i \le N)$ is the displacement of the signal at time $i / N \ \mathrm{[sec]}$. This signal is a $1$-second excerpt of a performance sound imitating some musical instrument, and its pitch is one of C4, D4, E4, F4, G4, A4, B4. In this problem, you may assume that the fundamental frequencies of these notes are, in order, 261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5 $\mathrm{Hz}$ (regarding fundamental frequencies, see also the explanations of the samples). Determine which pitch is being played and output the answer.
Notes
The method used to create the test cases for this problem is described at the end of this page.
Input
$N$ $A_1\ A_2 \ \dots \ A_N$
- $N = 44100$
- $-32768 \le A_i \le 32767$ $(i = 1, \dots, N)$
- All inputs are integers.
Output
Output the answer string (one of C4, D4, E4, F4, G4, A4, B4). Print a newline at the end.
Sample
Since small input data cannot be provided for this problem, the sample data has been prepared on GitHub Gist. Please download it from this link and use it as needed.Sample 1
Input
Output
C4
This is the sound of C4 played by Trumpet.
The figure below shows the beginning of the waveform data of Sample 1, plotted with waveform analysis software (in the figures below, the unit of the horizontal axis is seconds).
C4 being about $261.6 \mathrm{Hz}$. A characteristic of the input is that shifting the entire waveform (sequence) forward or backward by about $N / 261.6$ elements does not change the appearance of the data very much.
Sample 2
Input
Output
D4
This is the sound of D4 played by Pan Flute. The waveform is shown below.
D4.
Sample 3
Input
Output
E4
This is the sound of E4 played by Recorder. The waveform is shown below.
Supplement: How the Test Cases Were Created
The test cases used to judge submitted code in this problem were created by the following method.
- Using the software synthesizer Cakewalk TTS-1 on the DAW software Cakewalk by BandLab, a wav file is created in which a single note, one of
C4,D4,E4,F4,G4,A4,B4, is played for 8 seconds. The tones used were the presetsHarmonica,Violin,Trumpet,Shakuhachi,Pan Flute,Alto Sax,Church 1,Recorder. The format of the wav signal was a sampling rate of $44100~\mathrm{Hz}$ and a bit depth of $16$ bit. The pitch was also finely adjusted, but other settings were basically left unchanged from the defaults. - A contiguous segment exactly $1$ second long is cut out from the created wav file and used as the input of a test case. The position of the cut may have been chosen arbitrarily by the problem setter.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。