A coding device comprising: a pitch contour detection unit configured to detect a pitch contour that is information indicating a change in pitch of an input audio signal within a period; a dynamic time warping unit configured to: analyze the detected pitch contour; and determine, based on a result of the analysis, the number of pitch nodes that is an optimal number of pitches detected within the period, the optimal number of pitch nodes being variable and depending on parameters generated by a first encoder; and generate a first time warping parameter including information indicating the determined number of pitch nodes, a pitch change position (C(i)), and a pitch change ratio (Δp i), the pitch change position being a position where the change in pitch occurs in pitches of the number of pitch nodes, the pitch change ratio being a ratio of the change in pitch at the pitch change position; the first encoder configured to code the generated first time warping parameter to generate a coded time warping parameter; a time warping unit configured to correct, using the information obtained from the generated first time warping parameter, at least one pitch included in the pitches of the number of pitch nodes, to approximate the pitches of the number of pitch nodes to a predetermined reference value; a second encoder which codes the input audio signal at the pitch corrected by the time warping unit to generate a coded audio signal; and a multiplexer which multiplexes the coded time warping parameter generated by the first encoder and the coded audio signal generated by the second encoder to generate a bitstream. a pitch contour detection unit configured to detect a pitch contour that is information indicating a change in pitch of an input audio signal within a period; a dynamic time warping unit configured to: analyze the detected pitch contour; and determine, based on a result of the analysis, the number of pitch nodes that is an optimal number of pitches detected within the period, the optimal number of pitch nodes being variable and depending on parameters generated by a first encoder; and generate a first time warping parameter including information indicating the determined number of pitch nodes, a pitch change position (C(i)), and a pitch change ratio (Δp i), the pitch change position being a position where the change in pitch occurs in pitches of the number of pitch nodes, the pitch change ratio being a ratio of the change in pitch at the pitch change position; the first encoder configured to code the generated first time warping parameter to generate a coded time warping parameter; a time warping unit configured to correct, using the information obtained from the generated first time warping parameter, at least one pitch included in the pitches of the number of pitch nodes, to approximate the pitches of the number of pitch nodes to a predetermined reference value; a second encoder which codes the input audio signal at the pitch corrected by the time warping unit to generate a coded audio signal; and a multiplexer which multiplexes the coded time warping parameter generated by the first encoder and the coded audio signal generated by the second encoder to generate a bitstream.