フィルターのクリア

A doubt in ZERO PADDING IMPLEMENTATION

2 ビュー (過去 30 日間)
raj
raj 2012 年 1 月 28 日
actually i am applying short time fourier transform and i am implementing zero's to the end of the signal to match with the window length but i can see some artifacts in my plot with less power how can i avoid it can i avoid it by applying zeros between the signal like ex: 102030..... how can i do it.....

採用された回答

Image Analyst
Image Analyst 2012 年 1 月 28 日
Not sure I follow why you're trying to do this, but here is code for interleaving zeros in your array:
m = rand(1,10); % Sample data.
interleaved = zeros(1, 2*length(m));
interleaved(1:2:end) = m
  1 件のコメント
raj
raj 2012 年 1 月 28 日
I wanted to do this because when I add zeros to the nd of my signal I have some artifacts generated on my spectrogram so I wanted to try by adding zeros this way

サインインしてコメントする。

その他の回答 (1 件)

Wayne King
Wayne King 2012 年 1 月 29 日
Raj, You don't want to insert zeros as you have done. That is called upsampling by two. Upsampling by two contracts the spectrum of the input signal by a factor of two and results in imaging artifacts.
As a simple example:
n = 0:99;
x = cos(pi/2*n);
y = upsample(x,2);
xdft = fft(x);
xdft = xdft(1:length(x)/2+1);
freq = 0:(2*pi)/length(x):pi;
plot(freq,abs(xdft));
hold on;
freq1 = 0:(2*pi)/length(y):pi;
ydft = fft(y);
ydft = ydft(1:length(y)/2+1);
plot(freq1,abs(ydft),'r');
set(gca,'xtick',[pi/4 pi/2 3*pi/4])
The original sine wave at pi/2 radians/sample has contracted to pi/4 radians/sample and a new "image" has appeared at 3*pi/4.

カテゴリ

Help Center および File ExchangeTime-Frequency Analysis についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by