# DFT zero-padding of signals starting before n=0

If a signal starts before n=0, what part of the signal should be used to compute DFT after zero-padding? For example, x(n) = {1, 2, 3, 4, 5}, where x(-2) = 1 and x(0) = 3. If this signal is zero-padded to N=8, the new signal would be x'(n) = {1, 2, 3, 4, 5, 0, 0, 0}, where, again, x'(-2) = 1 and x'(0)=3. However, to compute the DFT of this zero-padded signal x'(0), should I use {1, 2, 3, 4, 5, 0, 0 , 0}, which starts with x'(-2), or should I use {3, 4, 5, 0, 0, 0, 1, 2}, which starts with x'(0) with the first few terms (n<0) folded over? In terms of the DFT X(k), I think its magnitude would be the same for the two approaches, but its phase would be different, right?

• but remember, since the DFT is circular, you can zero pad it on either end (or both ends) and the only difference in the DFT result will be a linear phase term corresponding to a rotation or circular-shift. – robert bristow-johnson Jan 29 at 5:22
{"ft_lang_label":"__label__en","ft_lang_prob":0.9002665,"math_prob":0.99099094,"size":1125,"snap":"2019-51-2020-05","text_gpt3_token_len":380,"char_repetition_ratio":0.11685995,"word_repetition_ratio":0.028571429,"special_character_ratio":0.3511111,"punctuation_ratio":0.18996416,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9956477,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-06T00:56:40Z\",\"WARC-Record-ID\":\"<urn:uuid:9a866555-7e43-4a44-bd21-a6fd4d671541>\",\"Content-Length\":\"130586\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:28913286-38b9-484a-a8d7-790243398dc5>\",\"WARC-Concurrent-To\":\"<urn:uuid:5301f087-5d85-4a59-a273-bb1483aa8bb6>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://dsp.stackexchange.com/questions/55139/dft-zero-padding-of-signals-starting-before-n-0\",\"WARC-Payload-Digest\":\"sha1:UD7LQRD2E5HGV45BWCXN5XK3RQBGL7VP\",\"WARC-Block-Digest\":\"sha1:N4KOEN37VRAEZJX7A4SJVT2MCYTKKLFV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540482954.0_warc_CC-MAIN-20191206000309-20191206024309-00246.warc.gz\"}"}