matlab padding fft changing frequencies

I'm trying to compare Matlab fft of a cosinus with two different zero padding. I thought that it wouldn't change the frequency response but when I superimpose the two curves, the frequencies are not the same. I suppose that there is something wrong with the way I do my two fft?

Fe = 8000;
F = 1680;
w = 2*pi*F;
N = 50;
P = 50;
T = 1/Fe;
t = (0:T:P*T);

x = real(exp(i*w*t))
x_reduced = x(1:P)

X = fft(x_reduced,N)
N = 1000;
Y = fft(x_reduced,N)


plot(abs(Y))
hold on
plot(abs(X),'*')

Thanks in advance

Answers


plot((0:999)/1000*Fe,abs(Y))
hold on
plot((0:49)/50*Fe,abs(X),'*')

You may need to align the frequencies of both cases.


Need Your Help

PHP Redirect with Custom Headers

php .htaccess redirect http-headers

I am writing a basic authorization system and I am struggling with it a bit. There are two files involved - index.php and login.php. The login form is pretty simple (it's inside index.php):

Can I define multiple static blocks?

java static block

Can I define multiple static blocks?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.