{"id":194,"date":"2012-04-21T10:03:06","date_gmt":"2012-04-21T09:03:06","guid":{"rendered":"http:\/\/lukasz.kocewiak.eu\/blog\/?p=194"},"modified":"2012-10-05T16:04:07","modified_gmt":"2012-10-05T15:04:07","slug":"oversampling-resampling-data-in-harmonic-data-processing","status":"publish","type":"post","link":"https:\/\/lukasz.kocewiak.eu\/blog\/2012\/04\/21\/oversampling-resampling-data-in-harmonic-data-processing\/","title":{"rendered":"Oversampling (resampling) data in harmonic data processing"},"content":{"rendered":"<p>When using a rectangular window, it is important to synchronize the measurement window accurately with the power system frequency to achieve integer multiple\u00a0of\u00a0periods in analysed time series (i.e. window period is and integer multiple of\u00a0analysed frequency component natural period). For example, if the power system frequency is 50.2 Hz whereas the window size is 200\u00a0ms, the fundamental frequency spectral line of the discrete Fourier transform is no longer projected (represented) by\u00a0one complex vector in the orthogonal basis but spanned over the whole basis. One can\u00a0even say that the power system frequency in the estimated spectrum becomes an\u00a0interharmonic with spectral leakage as a consequence. Therefore appropriate data should be prepared before the projection into frequency domain.<\/p>\n<p>In order to limit possible data processing errors the signal should be adjusted before spectral analysis. Power system frequency variation can be limited by application of\u00a0various interpolation methods. It is strongly recommended to always oversample the\u00a0analysed signal. In this particular case acquired waveforms with sample rate of\u00a044.1\u00a0kS\/s\/ch are oversampled up to 51.2\u00a0kS\/s\/ch. According to this procedure 1024 samples per cycle is obtained, which is an integer power of 2 and can be used to apply fast Fourier transform. Please note that for 10-cycle data blocks discrete Fourier transform should be applied.<\/p>\n<figure id=\"attachment_195\" aria-describedby=\"caption-attachment-195\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Frequency-estimation.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-195\" title=\"Frequency-estimation\" src=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Frequency-estimation-300x282.png\" alt=\"Frequency estimation\" width=\"300\" height=\"282\" srcset=\"https:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Frequency-estimation-300x282.png 300w, https:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Frequency-estimation.png 433w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-195\" class=\"wp-caption-text\">Figure 1  Single tone frequency. (a) Measured power system frequency variation. (b) Frequency variation after resampling (spline interpolation).<\/figcaption><\/figure>\n<p>Oversampling of each 10-cycle data blocks before spectrum estimation significantly limits fundamental frequency variation over analysed window and therefore the\u00a0stationarity assumption is strengthened for frequency component of interest (i.e.\u00a0linked with\u00a0the\u00a0fundamental frequency). As it can be seen in Figure 1 resampling with high precision definitely improves signal quality. The figure presents analysed one minute of\u00a0acquired voltage waveform and each point is an estimated fundamental frequency over 10-cycle rectangular window. The discrepancy as a difference between two measured values, given in Figure 1(b), is acceptably small and the sample standard deviation is 4.3548\u202210<sup>-6<\/sup>. Please note that scale 0.2s used on abscissa (i.e.\u00a0horizontal axis) in\u00a0Figure 1 denotes the step size between neighbouring samples. If there are 300 samples in presented results (as in Figure 1) the total duration is 1 minute (i.e. 0.2s\u2217300=60s).<\/p>\n<p>It can be seen that both factors such as main tone detection algorithm as well as\u00a0interpolation algorithm are crucial in appropriate harmonic magnitude and phase estimation. Various interpolation techniques can give different results. The most sophisticated unfortunately are usually the most time consuming. Therefore taking into consideration enormous amount of data to process from few months of multipoint measurements also the interpolation should be optimized and agreement between acceptable accuracy and calculation speed should be found.<\/p>\n<p>Roughly speaking, during interpolation process new samples between existing samples are computed. Different methods were used in data processing such as nearest (coerce) method, linear method, spline method, cubic method, and finite impulse response filter method\u00a0[1]. The nearest method finds the point nearest to <em>x<sub>i<\/sub><\/em>\u00a0 in an <em>X<\/em> array and then assigns the\u00a0corresponding <em>y<\/em> value in an interpolated <em>Y<\/em> to <em>y<sub>i<\/sub><\/em>. The linear method interpolates <em>y<sub>i<\/sub><\/em> on\u00a0the line which connects the two points (<em>x<sub>j<\/sub><\/em>,<em>x<sub>j+1<\/sub><\/em>) when the\u00a0corresponding location <em>x<sub>i<\/sub><\/em> of\u00a0interpolated value <em>y<sub>i<\/sub><\/em> which is located between the two points in\u00a0an <em>X<\/em> array. The spline method known also as cubic spline method is almost always the\u00a0most suitable solution. Within the method the third-order polynomial for each interval between two adjacent points in <em>X<\/em> (<em>x<sub>j<\/sub><\/em>,<em>x<sub>j+1<\/sub><\/em>) is derived. The polynomials have to\u00a0meet the\u00a0following conditions: the first and second derivatives at <em>x<sub>j<\/sub><\/em> and <em>x<sub>j+1<\/sub><\/em> are\u00a0continuous, the\u00a0polynomials pass all\u00a0the specified data points, the second derivatives at the beginning and end are zero. The\u00a0cubic Hermitian spline method is\u00a0the\u00a0piecewise cubic Hermitian interpolation. This method is similar to cubic spline interpolation and derives a third-order polynomial but\u00a0in\u00a0Hermitian form for each interval (<em>x<sub>j<\/sub><\/em>,<em>x<sub>j+1<\/sub><\/em>) and ensures only the\u00a0first derivatives of the interpolation polynomials are continuous. Compared to the cubic spline method, the cubic Hermitian method is\u00a0characterized by better local property. The cubic Hermite interpolation method guarantees that the first derivative of\u00a0the\u00a0interpolant is\u00a0continuous and sets the\u00a0derivative at the endpoints in order to\u00a0preserve the original shape and monotonicity of the data\u00a0[2]. Also interpolation based on finite impulse response filter is\u00a0popular\u00a0[3],\u00a0[4]. This method provides excellent results also\u00a0for\u00a0frequency analysis, although it is more intensive computationally\u00a0[2].<\/p>\n<div align=\"center\">\n<table style=\"text-align: center; width: 580px; border: 0; margin: auto; border-collapse: collapse; border-spacing: 0;\">\n<tbody>\n<tr style=\"padding: 0; border: 0;\">\n<td><strong>Order<\/strong><\/td>\n<td><strong>Interpolation method<\/strong><\/td>\n<td><strong>Computation time [ms]<\/strong><\/td>\n<td><strong>Marker<\/strong><\/td>\n<\/tr>\n<tr style=\"padding: 0; border: 0;\">\n<td style=\"padding: 0; border: 0;\">1<\/td>\n<td style=\"padding: 0; border: 0;\">Linear<\/td>\n<td style=\"padding: 0; border: 0;\">110<\/td>\n<td style=\"padding: 0; border: 0;\">x<\/td>\n<\/tr>\n<tr style=\"padding: 0; border: 0;\">\n<td style=\"padding: 0; border: 0;\">2<\/td>\n<td style=\"padding: 0; border: 0;\">Coerce<\/td>\n<td style=\"padding: 0; border: 0;\">70<\/td>\n<td style=\"padding: 0; border: 0;\">*<\/td>\n<\/tr>\n<tr style=\"padding: 0; border: 0;\">\n<td style=\"padding: 0; border: 0;\">3<\/td>\n<td style=\"padding: 0; border: 0;\">Cubic spline<\/td>\n<td style=\"padding: 0; border: 0;\">130<\/td>\n<td style=\"padding: 0; border: 0;\">\u2022<\/td>\n<\/tr>\n<tr style=\"padding: 0; border: 0;\">\n<td style=\"padding: 0; border: 0;\">4<\/td>\n<td style=\"padding: 0; border: 0;\">Hermitian spline<\/td>\n<td style=\"padding: 0; border: 0;\">430<\/td>\n<td style=\"padding: 0; border: 0;\">+<\/td>\n<\/tr>\n<tr style=\"padding: 0; border: 0;\">\n<td style=\"padding: 0; border: 0;\">5<\/td>\n<td style=\"padding: 0; border: 0;\">FIR filter<\/td>\n<td style=\"padding: 0; border: 0;\">290<\/td>\n<td style=\"padding: 0; border: 0;\">\u2217<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Table above shows the computation time of data interpolation with different algorithms. In each of the cases the presented time is measured for resampling of 10 cycles of measured data. It can be seen that the simplest algorithms exhibit less computation burden. On the other hand in many cases simple algorithms cannot give satisfactory interpolation results and thus affect the harmonic calculation results. Figure 2 shows how different interpolation techniques affect harmonic magnitude estimation from measurements carried out at the LV side of the wind turbine transformer. It can be seen that the coerce method is affected the worst while other algorithms give comparable results.<\/p>\n<figure id=\"attachment_207\" aria-describedby=\"caption-attachment-207\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Oversampling-transformer-LV-side.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-207\" title=\"Oversampling-transformer-LV-side\" src=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Oversampling-transformer-LV-side-300x150.png\" alt=\"Oversampled measurements\" width=\"300\" height=\"150\" srcset=\"https:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Oversampling-transformer-LV-side-300x150.png 300w, https:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Oversampling-transformer-LV-side.png 579w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-207\" class=\"wp-caption-text\">Figure 2 Different interpolation techniques used in oversampling of waveforms measured at LV side of the wind turbine transformer.<\/figcaption><\/figure>\n<p>It was observed that in case of more distorted waveforms (e.g. gird-side converter output voltage) interpolation method choice plays a crucial role. In Figure 3 one can see that also linear interpolation and cubic Hermitian spline interpolation do not give satisfactory results. Therefore the most suitable for harmonic components estimation appear to be cubic spline interpolation as well as finite impulse response filter interpolation. Since the spline method (as presented in table above) is less time consuming, this method was used in further data processing. The selected measurement period was\u00a0selected when the power system frequency were varying below 50 Hz or above 50 Hz.<\/p>\n<figure id=\"attachment_208\" aria-describedby=\"caption-attachment-208\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Oversampling-converter-AC-terminals.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-208\" title=\"Oversampling-converter-AC-terminals\" src=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Oversampling-converter-AC-terminals-300x150.png\" alt=\"Oversampled measurements\" width=\"300\" height=\"150\" srcset=\"https:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Oversampling-converter-AC-terminals-300x150.png 300w, https:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/uploads\/2012\/04\/Oversampling-converter-AC-terminals.png 579w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-208\" class=\"wp-caption-text\">Figure 3 Different interpolation techniques used in oversampling of waveforms measured at the grid-side converter AC terminals.<\/figcaption><\/figure>\n<p>[1] S. C. Chapra and R. Canale, <em>Numerical Methods for Engineers: With Software and Programming Applications<\/em>, 6th ed. McGraw-Hill Science, 2009.<br \/>\n[2] National Instruments, \"LabVIEW 2011 Help,\" National Instruments Manual, 2011.<br \/>\n[3] R. A. Losada, \"Digital Filters with MATLAB,\" The Mathworks, 2008.<br \/>\n[4] R. W. Schafer and L. R. Rabiner, \"A digital signal processing approach to interpolation,\" <em>Proceedings of the IEEE<\/em>, vol. 61, no. 6, pp. 692-702, Jun. 1973.<\/p>\n<div class='shareinpost'><ul class=\"socialwrap row\"><li class=\"iconOnly\"><a rel=\"nofollow\" target=\"_blank\" href=\"http:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Flukasz.kocewiak.eu%2Fblog%2F2012%2F04%2F21%2Foversampling-resampling-data-in-harmonic-data-processing%2F&amp;t=Oversampling+%28resampling%29+data+in+harmonic+data+processing\" title=\"Recommend this post : Oversampling (resampling) data in harmonic data processing on Facebook\" ><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/images\/blank.gif\" height=\"24\" style=\"background: transparent url(http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/default\/24\/sprite-24.png) no-repeat;padding:0;margin:0;height:24px;width:24px;background-position:-275px 0px\" class=\"image-24\" width=\"24\" alt=\"facebook\"\/> <span class=\"head\">Recommend on Facebook<\/span><\/a><\/li><li class=\"iconOnly\"><a rel=\"nofollow\" target=\"_blank\" href=\"http:\/\/www.linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Flukasz.kocewiak.eu%2Fblog%2F2012%2F04%2F21%2Foversampling-resampling-data-in-harmonic-data-processing%2F&amp;title=Oversampling+%28resampling%29+data+in+harmonic+data+processing&amp;&amp;summary=When+using+a+rectangular+window%2C+it+is+important+to+synchronize+the+measurement+window+accurately+with+the+power+system+frequency+to+achieve+integer+multiple%C2%A0of%C2%A0periods+in+analysed+time+series+%28i.e.+window+period+is+and+integer+multiple+of%C2%A0analysed+frequency+component+natural+period%29.+For+example%2C+if+the+power+syste\" title=\"Share this post : Oversampling (resampling) data in harmonic data processing on Linkedin\" ><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/images\/blank.gif\" height=\"24\" style=\"background: transparent url(http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/default\/24\/sprite-24.png) no-repeat;padding:0;margin:0;height:24px;width:24px;background-position:-675px 0px\" class=\"image-24\" width=\"24\" alt=\"linkedin\"\/> <span class=\"head\">Share on Linkedin<\/span><\/a><\/li><li class=\"iconOnly\"><a rel=\"nofollow\" target=\"_blank\" href=\"http:\/\/twitter.com\/home\/?status=https%3A%2F%2Flukasz.kocewiak.eu%2Fblog%2F2012%2F04%2F21%2Foversampling-resampling-data-in-harmonic-data-processing%2F\" title=\"Tweet this post : Oversampling (resampling) data in harmonic data processing on Twitter\" ><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/images\/blank.gif\" height=\"24\" style=\"background: transparent url(http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/default\/24\/sprite-24.png) no-repeat;padding:0;margin:0;height:24px;width:24px;background-position:-1325px 0px\" class=\"image-24\"  width=\"24\"  alt=\"twitter\"\/> <span class=\"head\">Tweet about it<\/span><\/a><\/li><li class=\"iconOnly\"><a rel=\"_self\" href=\"https:\/\/lukasz.kocewiak.eu\/blog\/2012\/04\/21\/oversampling-resampling-data-in-harmonic-data-processing\/feed\" title=\"Follow this post : Oversampling (resampling) data in harmonic data processing comments\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/images\/blank.gif\" height=\"24\"  width=\"24\" style=\"background: transparent url(http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/default\/24\/sprite-24.png) no-repeat;padding:0;margin:0;height:24px;width:24px;background-position:-1100px 0px\" class=\"image-24\"  alt=\"rss\" \/> <span class=\"head\">Subscribe to the comments on this post<\/span><\/a><\/li><li class=\"iconOnly\"><a rel=\"_self\" href=\"mailto:?subject=\u0141ukasz%20Kocewiak%20:%20Oversampling%20(resampling)%20data%20in%20harmonic%20data%20processing&amp;body=here%20is%20a%20link%20to%20a%20site%20I%20really%20like.%20%20%20https:\/\/lukasz.kocewiak.eu\/blog\/2012\/04\/21\/oversampling-resampling-data-in-harmonic-data-processing\/\" title=\"Tell a friend about this post : Oversampling (resampling) data in harmonic data processing \"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/images\/blank.gif\" height=\"24\"  width=\"24\" style=\"background: transparent url(http:\/\/lukasz.kocewiak.eu\/blog\/wp-content\/plugins\/share-and-follow\/default\/24\/sprite-24.png) no-repeat;padding:0;margin:0;height:24px;width:24px;background-position:-250px 0px\" class=\"image-24\"  alt=\"email\" \/> <span class=\"head\">Tell a friend<\/span><\/a><\/li><\/ul><div class=\"clean\"><\/div> <\/div>","protected":false},"excerpt":{"rendered":"<p>When using a rectangular window, it is important to synchronize the measurement window accurately with the power system frequency to achieve integer multiple\u00a0of\u00a0periods in analysed time series (i.e. window period is and integer multiple of\u00a0analysed frequency component natural period). For example, if the power system frequency is 50.2 Hz whereas the window size is 200\u00a0ms, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[15,8,11,14],"class_list":["post-194","post","type-post","status-publish","format-standard","hentry","category-harmonics","tag-data-processing","tag-harmonics-2","tag-power-quality","tag-resampling"],"_links":{"self":[{"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/posts\/194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/comments?post=194"}],"version-history":[{"count":17,"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":262,"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/posts\/194\/revisions\/262"}],"wp:attachment":[{"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/media?parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/categories?post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lukasz.kocewiak.eu\/blog\/wp-json\/wp\/v2\/tags?post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}