diff options
-rw-r--r-- | R/idframe.R | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/R/idframe.R b/R/idframe.R index b207ebc..19530fc 100644 --- a/R/idframe.R +++ b/R/idframe.R @@ -151,14 +151,14 @@ idfrd <- function(response,freq,Ts){ plot.idfrd <- function(x){ require(ggplot2);require(reshape2);require(signal) - mag <- 20*log10(Mod(object$resp)) - phase <- -360/2/pi*unwrap(Arg(object$resp)) - sys_df <- data.frame(Frequency = object$freq,Gain = mag,Phase = phase) + mag <- 20*log10(Mod(x$resp)) + phase <- -360/2/pi*unwrap(Arg(x$resp)) + sys_df <- data.frame(Frequency = x$freq,Gain = mag,Phase = phase) melted_sys_df <- melt(sys_df, id.var = c("Frequency")) bode <- ggplot(sys_df, aes(x = Frequency)) + geom_line(colour="steelblue") + scale_x_log10() + theme_bw() + - geom_vline(xintercept=max(object$freq),size=1.2) + geom_vline(xintercept=max(x$freq),size=1.2) bode_gain <- bode + aes(y = Gain) bode_phase <- bode + aes(y = Phase) |