Forums

how can I see fourier transform?

Started by zghofrani October 26, 2002
I want to see the fourier transform of a function, say
cos(t). I typed:
>>syms t;
>>fourier (cos(t))

but it gives error and says:

??? syms t
Missing operator, comma, or semi-colon.

what should I do?



Hi,

Do you have the Symbolic math toolbox?
Does help symbolic give the list of functions?

Navan

--- zghofrani <> wrote:
> I want to see the fourier transform of a function,
> say
> cos(t). I typed:
> >>syms t;
> >>fourier (cos(t))
>
> but it gives error and says:
>
> ??? syms t
> Missing operator, comma, or semi-colon.
>
> what should I do?


__________________________________________________


Hi,
To the best of my knowledge, There is no function called fourier in Matlab
unless you have got your own .m file.

Express cos t in terms of Z-Transform or Laplace

Then use the function freqz(b,a) -- where b = NUmerator coefficients,
a = Denominator coefficients.

Kind Regards,

Prakash

-- Original Message --

>I want to see the fourier transform of a function, say
>cos(t). I typed:
>>>syms t;
>>>fourier (cos(t))
>
>but it gives error and says:
>
>??? syms t
>Missing operator, comma, or semi-colon.
>
>what should I do? >
>_____________________________________
>Note: If you do a simple "reply" with your email client, only the author
>of this message will receive your answer. You need to do a "reply all"
>if you want your answer to be distributed to the entire group.
>
>_____________________________________
>About this discussion group:
>
>To Join:
>
>To Post:
>
>To Leave:
>
>Archives: http://www.yahoogroups.com/group/matlab
>
>More DSP-Related Groups: http://www.dsprelated.com/groups.php3
>
>">http://docs.yahoo.com/info/terms/ >
>



Hi,
The below code should get the magnitude and the phase response.

t = 0:1/100:10-1/100;
x = cos(t);

y = fft(x);
m = abs(y);
p = unwrap(angle(y));

f = (0:length(y)-1)'*100/length(y);
subplot(2,1,1), plot(f,m),
ylabel('Abs. Magnitude'), grid on
subplot(2,1,2), plot(f,p*180/pi)
ylabel('Phase [Degrees]'), grid on
xlabel('Frequency [Hertz]')
Kind Regards,

Prakash -- Original Message --

>I want to see the fourier transform of a function, say
>cos(t). I typed:
>>>syms t;
>>>fourier (cos(t))
>
>but it gives error and says:
>
>??? syms t
>Missing operator, comma, or semi-colon.
>
>what should I do? >
>_____________________________________
>Note: If you do a simple "reply" with your email client, only the author
>of this message will receive your answer. You need to do a "reply all"
>if you want your answer to be distributed to the entire group.
>
>_____________________________________
>About this discussion group:
>
>To Join:
>
>To Post:
>
>To Leave:
>
>Archives: http://www.yahoogroups.com/group/matlab
>
>More DSP-Related Groups: http://www.dsprelated.com/groups.php3
>
>">http://docs.yahoo.com/info/terms/ >
>


Hi Prakash,
If you have the symbolic math toolbox, the
following commands

syms t;
fourier(cos(t))

will print

pi*Dirac(w-1)+pi*Dirac(w+1)

Regards
Navan --- wrote:
> Hi,
> To the best of my knowledge, There is no function
> called fourier in Matlab
> unless you have got your own .m file.
>
> Express cos t in terms of Z-Transform or Laplace
>
> Then use the function freqz(b,a) -- where b =
> NUmerator coefficients,
> a = Denominator coefficients.
>
> Kind Regards,
>
> Prakash
>
> -- Original Message --
>
> >I want to see the fourier transform of a function,
> say
> >cos(t). I typed:
> >>>syms t;
> >>>fourier (cos(t))
> >
> >but it gives error and says:
> >
> >??? syms t
> >Missing operator, comma, or semi-colon.
> >
> >what should I do?


__________________________________________________


Hi every body;

Thanks for your answers to my question. The reason I got that error was that I
didn't install "math symbolic toolbox". Now that I've done that, it understands
"syms" command, but after I write fourier (cos(t))it writes all the sentences
which I paste here:
License Manager Error -5.Cannot find a license for Symbolic_Toolbox.Make sure
your license file is correct.No such feature existsFeature:
Symbolic_ToolboxLicense path:
D:\MATLAB\bin\win32\license.dat;D:\MATLAB\bin\win32\ - *.licFLEXlm error:
-5,357For more information, see The MathWorks Support page
athttp://www.mathworks.com/support and search for"license manager error
-5"License Manager Error -5.Cannot find a license for Symbolic_Toolbox.Make sure
your license file is correct.No such feature existsFeature:
Symbolic_ToolboxLicense path:
D:\MATLAB\bin\win32\license.dat;D:\MATLAB\bin\win32\ - *.licFLEXlm error:
-5,357For more information, see The MathWorks Support page
athttp://www.mathworks.com/support and search for"license manager error -5"???
Unable to checkout a license for the Symbolic ToolboxError in ==>
D:\MATLAB\toolbox\symbolic\maplemex.dll-----\
------------------------------- Segmentation violation detected at Tue Oct
29 04:18:27
2002Conf\
iguration: MATLAB Version: 6.1.0.450 (R12.1) Operating System: Microsoft
Windows 98 Window System: Version 4.10 (Build 1998: ) Processor ID:
x86 Family 6 Model 6 Stepping 0, GenuineIntel Virtual Machine: Java 1.1.8 from
Sun Microsystems Inc.Register State: EAX = 00000000 EBX = 03c6bc40 ECX =
00000000 EDX = 0ccbeca0 ESI = 01ed9488 EDI = 005a685c EBP = 01ed93c8 ESP =
01ed93c8 EIP = 00632126 FLG = 00010202Stack Trace: [0]
LIBMEX.DLL:_mexMexInformation(0, 0x026526c0 "maple", 0x0ccbeca0
"D:\MATLAB\toolbox\symbolic\maple..", 0x33333333) + 6 bytes [1]
M_INTERPRETER.DLL:_inCallMexFunction(2, 0x01ed975c, 1, 0x01ed9860) + 804 bytes
[2] M_INTERPRETER.DLL:_inRunMexFile(2, 0x01ed975c, 1, 0x01ed9860) + 121 bytes
[3] M_INTERPRETER.DLL:_inExecMexFile(2, 1, 0x01ed9860, 0x03c6bc40) + 82 bytes
[4] M_INTERPRETER.DLL:_inExecFunction(2, 1, 0x01ed9860, 0x03c6bc40) + 38 bytes
[5] M_INTERPRETER.DLL:_inMMexExecute(542, 0x03c6bc40, 2, 1) + 533 bytes [6]
M_INTERPRETER.DLL:_inInterPcode(1, 0x01edaa90, 1, 0x03bed1f0) + 1808 bytes [7]
M_INTERPRETER.DLL:_inWord(2, 0x01eda788 "g;", 1, 0x01edaa90) + 622 bytes [8]
M_INTERPRETER.DLL:_inWordsj(2, 0x01eda788 "g;", 1, 0x01edaa90) + 823 bytes [9]
M_INTERPRETER.DLL:_inRunMP(2, 0x01eda788 "g;", 1, 0x01edaa90) + 141 bytes [10]
M_INTERPRETER.DLL:_inExecMFile(2, 1, 0x01edaa90, 0x03bed1f0) + 70 bytes [11]
M_INTERPRETER.DLL:_inExecFunction(2, 1, 0x01edaa90, 0x03bed1f0) + 38 bytes [12]
M_INTERPRETER.DLL:_inMMexExecute(531, 0x03bed1f0, 2, 1) + 533 bytes [13]
M_INTERPRETER.DLL:_inInterPcode(1, 0x01edbcc0, 3, 0x03bec170) + 1808 bytes [14]
M_INTERPRETER.DLL:_inWord(1, 0x01edb9b8, 3, 0x01edbcc0) + 622 bytes [15]
M_INTERPRETER.DLL:_inWordsj(1, 0x01edb9b8, 3, 0x01edbcc0) + 823 bytes [16]
M_INTERPRETER.DLL:_inRunMP(1, 0x01edb9b8, 3, 0x01edbcc0) + 141 bytes [17]
M_INTERPRETER.DLL:_inExecMFile(1, 3, 0x01edbcc0, 0x03bec170) + 70 bytes [18]
M_INTERPRETER.DLL:_inExecFunction(1, 3, 0x01edbcc0, 0x03bec170) + 38 bytes [19]
M_INTERPRETER.DLL:_inMMexExecute(531, 0x03bec170, 1, 3) + 533 bytes [20]
M_INTERPRETER.DLL:_inInterPcode(1, 0x01edd0e0, 1, 0x03bebc48) + 1808 bytes [21]
M_INTERPRETER.DLL:_inWord(1, 0x01edcbe8, 1, 0x01edd0e0) + 622 bytes [22]
M_INTERPRETER.DLL:_inWordsj(1, 0x01edcbe8, 1, 0x01edd0e0) + 823 bytes [23]
M_INTERPRETER.DLL:_inRunMP(1, 0x01edcbe8, 1, 0x01edd0e0) + 141 bytes [24]
M_INTERPRETER.DLL:_inExecMFile(1, 1, 0x01edd0e0, 0x03bebc48) + 70 bytes [25]
M_INTERPRETER.DLL:_inExecFunction(1, 1, 0x01edd0e0, 0x03bebc48) + 38 bytes [26]
M_INTERPRETER.DLL:_inInternalFcnOverload(267, 1, 267, 0x01edd0e0) + 65 bytes
[27] M_INTERPRETER.DLL:_inExecuteInternalFcn(267, 1, 1, 0) + 592 bytes [28]
M_INTERPRETER.DLL:_inInterPcode(2, 0x01eddb58, 0, 0) + 2320 bytes [29]
M_INTERPRETER.DLL:_in_local_call_eval_function(0, 0x009dd840, 0x01eddb58,
0x01eddbec) + 174 bytes [30]
M_INTERPRETER.DLL:_inEvalStringWithIsVarFcn(0x0c509578 "fourier(cos(t))\n", 16,
0, 0) + 340 bytes [31] M_INTERPRETER.DLL:_inEvalString(0x0c509578
"fourier(cos(t))\n", 16, 0, 0) + 50 bytes [32]
M_INTERPRETER.DLL:_inEvalCmdWithLocalReturnandtype(0x0c509578
"fourier(cos(t))\n", 0, 2, 0x01eddd1c) + 68 bytes [33]
M_INTERPRETER.DLL:_inEvalCmdNoEnd(0x0c509578 "fourier(cos(t))\n", 0xf2084782, 0,
11) + 16 bytes [34] MATLAB.EXE:_mnParser(0, 0x815da9b5, 0, 39) + 980 bytes
[35] MATLAB.EXE:_WinMain@16(4194304, 0, 0x815da9b5, 1) + 3136 bytes [36]
MATLAB.EXE:_WinMainCRTStartup(0, 0x815df024, 0x00f80000, 0x6c74614d) + 308 bytes
[37] KERNEL32.DLL:0xbff8b538(0x815ded7c, 0x815df024, 8, 0) [38]
KERNEL32.DLL:0xbff8b3ea [39] KERNEL32.DLL:0xbff89dadPlease follow these steps
in reporting this problem to The MathWorks sothat we have the best chance of
correcting it: 1. Send us this crash report. For your convenience, this
information has been recorded in: C:\WIN98\TEMP\matlab_crash_dump.65305
2. Provide a brief description of what you were doing when this problem
occurred. 3. If possible, include M-files, MEX-files, or MDL-files that aid
in reproducing it. 4. E-mail or FAX this information to us at:
E-mail: FAX:
508-647-7201Thank you for your assistance. Please save your workspace and
restartMATLAB before continuing your work.Error in ==>
D:\MATLAB\toolbox\symbolic\maple.mOn line 116 ==> [result,status] =
maplemex(statement);Error in ==> D:\MATLAB\toolbox\symbolic\@sym\maple.mOn line
74 ==> [result,status] = maple(statement);Error in ==>
D:\MATLAB\toolbox\symbolic\@sym\cos.mOn line 7 ==> Y = maple('map','cos',X);

Can somebody guide me what to do
Regards,Zeinab Ghofrani
--- navaneetha krishnan wrote:> Hi,> > Do you have the Symbolic math toolbox?>
Does help symbolic give the list of functions?> > Navan> > --- zghofrani
wrote:> > I want to see the fourier transform of a function,> > say> > cos(t). I
typed:> > >>syms t;> > >>fourier (cos(t))> > > > but it gives error and says:> >
> > ??? syms t> > Missing operator, comma, or semi-colon.> > > > what should I
do?



Hi
As suggested by the error message you can try the
options given in the page

http://www.mathworks.com/support/solutions/data/25326.shtml

Navan

--- Zeinab Ghofrani <> wrote:
> Hi every body;
>
> Thanks for your answers to my question. The reason I
> got that error was that I didn't install "math
> symbolic toolbox". Now that I've done that, it
> understands "syms" command, but after I write
> fourier (cos(t))it writes all the sentences which I
> paste here:
> License Manager Error -5.Cannot find a license for
> Symbolic_Toolbox.Make sure your license file is
> correct.No such feature existsFeature:
> Symbolic_ToolboxLicense path:
> D:\MATLAB\bin\win32\license.dat;D:\MATLAB\bin\win32\
> - *.licFLEXlm error: -5,357For more information,
> see The MathWorks Support page
> athttp://www.mathworks.com/support and search
> for"license manager error -5"License Manager Error
> -5.Cannot find a license for Symbolic_Toolbox.Make
> sure your license file is correct.No such feature
> existsFeature: Symbolic_ToolboxLicense path:
> D:\MATLAB\bin\win32\license.dat;D:\MATLAB\bin\win32\
> - *.licFLEXlm error: -5,357For more information,
> see The MathWorks Support page
> athttp://www.mathworks.com/support and search
> for"license manager error -5"??? Unable to checkout
> a license for the Symbolic ToolboxError in ==>
>
D:\MATLAB\toolbox\symbolic\maplemex.dll-----\
-------------------------------
> Segmentation violation detected at Tue Oct 29
> 04:18:27
>
2002Conf\
iguration: __________________________________________________



Hello,

I found out that when I installed "symbolic toolbox" I
didn't select the alternative which overwrited the
licence file. Now that I've installed it again the
problem doesn't exist anymore. So thank you for all
the good pieces of advice.

Zeinab Ghofrani
--- navaneetha krishnan <> wrote:
> Hi
> As suggested by the error message you can try the
> options given in the page
http://www.mathworks.com/support/solutions/data/25326.shtml
>
> Navan
>
> --- Zeinab Ghofrani <> wrote:
> > Hi every body;
> >
> > Thanks for your answers to my question. The reason
> I
> > got that error was that I didn't install "math
> > symbolic toolbox". Now that I've done that, it
> > understands "syms" command, but after I write
> > fourier (cos(t))it writes all the sentences which
> I
> > paste here:
> > License Manager Error -5.Cannot find a license for
> > Symbolic_Toolbox.Make sure your license file is
> > correct.No such feature existsFeature:
> > Symbolic_ToolboxLicense path:
> >
> D:\MATLAB\bin\win32\license.dat;D:\MATLAB\bin\win32\
> > - *.licFLEXlm error: -5,357For more
> information,
> > see The MathWorks Support page
> > athttp://www.mathworks.com/support and search
> > for"license manager error -5"License Manager Error
> > -5.Cannot find a license for Symbolic_Toolbox.Make
> > sure your license file is correct.No such feature
> > existsFeature: Symbolic_ToolboxLicense path:
>
> >
> D:\MATLAB\bin\win32\license.dat;D:\MATLAB\bin\win32\
> > - *.licFLEXlm error: -5,357For more
> information,
> > see The MathWorks Support page
> > athttp://www.mathworks.com/support and search
> > for"license manager error -5"??? Unable to
> checkout
> > a license for the Symbolic ToolboxError in ==>
> >
>
D:\MATLAB\toolbox\symbolic\maplemex.dll-----\
-------------------------------
> > Segmentation violation detected at Tue Oct
> 29
> > 04:18:27
> >
>
2002Conf\
iguration:
>
>
> __________________________________________________


__________________________________________________