How Fourier Synthesis is performed using Matlab ?

I have read about Fourier Synthesis
http://whatis.techtarget.com/definition/Fourier-synthesisFourier-synthesis I want to clear my concept about Fourier Synthesis using Matlab .But don't know how to do this.
So can anybody show me how Fourier Synthesis is performed using Matlab?

Respuestas (2)

Youssef  Khmou
Youssef Khmou el 18 de Mayo de 2015
Editada: Youssef Khmou el 18 de Mayo de 2015
Fourier synthesis is simple application of coefficients summation either numerically or symbolically, Fourier decomposition requires certain conditions of the input function, you can start with a simple example which is an approximation of a square wave of 2 Hz, using 11 terms :
Fs=150;
t=0:1/Fs:4-1/Fs;
f=2;
x=square(2*pi*f*t);
figure;
plot(t,x);
axis([0 1 -2 2]);
% Approximation with Fourier decomposition
y=0;
N=11;
for r=1:2:N
y=y+sin(2*pi*f*t*r)/r;
end
hold on;
plot(t,y,'r');
xlabel('t');
ylabel('magnitude');
hold off;

1 comentario

Ahmed Mujtaba
Ahmed Mujtaba el 16 de Nov. de 2016
Thanks.. Exactly what I was looking for. Simple and Compact.

Iniciar sesión para comentar.

Image Analyst
Image Analyst el 18 de Mayo de 2015

1 voto

There is nothing at that link. I don't know what Fourier Synthesis might be synthesizing. I don't think computing the Fourier spectrum of a signal or image is called "synthesizing", at least not by anyone I know, so I'm not really sure. You can synthesize things though, such as the attached demo where I synthesize clouds by manipulating the Fourier Spectrum.

4 comentarios

@Image Analyst thank for both of your code. But I am getting following errors in both of the code
A)For clouds.m file 1)How should I vary values of "h" ? also 2) when i run the code ,error is
v =
8.1.0.604 (R2013a)
Octave =
0
Attempt to execute SCRIPT fft2 as a function: C:\Users\RK\Documents\MATLAB\fft2.m
Error in noiseonf (line 47) imfft = fft2(im); % Take fft of image.
Error in clouds (line 55) grayImage = noiseonf(rows, columns, h(index)); % The scale changes h with each new iteration.
>> B) noiseonf.m code, error is Error using noiseonf (line 44) Not enough input arguments.
>>
You made your own script or function called fft2 and it looks like that is being used in preference to the real one. This is what you should see:
>> which fft2
C:\Program Files\MATLAB\R2015a\toolbox\matlab\datafun\fft2.m
Use a different name for your own version of it that you've placed in C:\Users\RK\Documents\MATLAB so that there is no conflict.
ramdas patil
ramdas patil el 19 de Mayo de 2015
@Image Analyst sorry but when I run clouds.m file and click on "CONSTANT H ", I am still getting the following error
Attempted to access radius(346.5,615.5); index must be a positive integer or logical.
Error in noiseonf (line 59) radius(rows/2+1,columns/2+1) = 1; % .. avoid division by zero.
Error in clouds (line 53) grayImage = noiseonf(rows, columns, 1.7); % 1.7 is a good value.
>>
Image Analyst
Image Analyst el 19 de Mayo de 2015
Make sure that you're passing in an even number for rows and columns.

Iniciar sesión para comentar.

Categorías

Preguntada:

el 18 de Mayo de 2015

Comentada:

el 16 de Nov. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by